mysql_real_scape_string is undefined?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
m2babaey
Forum Contributor
Posts: 364
Joined: Sun May 20, 2007 9:26 am

mysql_real_scape_string is undefined?

Post 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?
User avatar
Gente
Forum Contributor
Posts: 252
Joined: Wed Jun 13, 2007 9:43 am
Location: Ukraine, Kharkov
Contact:

Post by Gente »

mysql_real_escape_string() is the correct function
m2babaey
Forum Contributor
Posts: 364
Joined: Sun May 20, 2007 9:26 am

Post by m2babaey »

It seems that when that functions detect an special chatacter they send a parse error
is that right?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

No.
m2babaey
Forum Contributor
Posts: 364
Joined: Sun May 20, 2007 9:26 am

Post 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
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

mysql_real_escape_string
You forgot an e
Post Reply