Page 1 of 1

mysql_real_scape_string is undefined?

Posted: Wed Jul 18, 2007 6:18 am
by m2babaey
Hi
I was testing this cod:

Code: Select all

<?
include 'global.php';
$text="new to aspx
Hi
I know html and have just learnt php
now I want to start learning C# and aspx (aspX)
what are the requirements and which one should I begin with first?
Also I'm not comfortable with w3school. what sources do you suggest to use for the turorial
";
pak($text);
echo $text;
?>
but it prompted this error:

Fatal error: Call to undefined function: mysql_real_scape_string() in g:\programs\easyphp1-8\www\takfekr\htdocs\functions.php on line 39

pak() is defined in function.php like this:

Code: Select all

function pak($chars){
$chars= htmlspecialchars($chars);
$chars= mysql_real_scape_string($chars);
return $chars;
}
Why this happens? isn't that function defined in php?

Posted: Wed Jul 18, 2007 6:21 am
by Gente
mysql_real_escape_string() is the correct function

Posted: Wed Jul 18, 2007 6:46 am
by m2babaey
It seems that when that functions detect an special chatacter they send a parse error
is that right?

Posted: Wed Jul 18, 2007 6:58 am
by feyd
No.

Posted: Wed Jul 18, 2007 7:14 am
by m2babaey
the codes I used for $text sent a parse error (exept the one in my first post and other ordinary texts)
could someone give me a code and predict the result so I can test it and see what will happen?
thanks

Posted: Wed Jul 18, 2007 7:20 am
by volka
mysql_real_escape_string
You forgot an e