note 86759 added to function.mysql-real-escape-string
| From: | willekej at yahoo dot com | Date: | Sun, 02 Nov 2008 15:10:34 +0000 |
| Subject: | note 86759 added to function.mysql-real-escape-string | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-146049@lists.php.net to get a copy of this message | ||
I think it should be noted that the my_sql_escape_string also leaves the #-symbol unchanged. For
instance the code
@ $con = mysql_connect(..., ..., ...);
$user_id = '1 #';
$password = '?';
$user_id = mysql_real_escape_string($user_id,$con);
$password = mysql_real_escape_string($password,$con);
$query = "SELECT * FROM users WHERE user_id = $user_id AND password
='$password'" ;
echo $query;
generates the SQL-query
SELECT * FROM gebruikers WHERE user_id = 1 # AND password ='?'
(Everything behind the #-symbol is considered a comment)
Please inform me if I'm mistaken,
Kind regards,
Jan
----
Server IP: 195.207.10.20
Probable Submitter: 88.197.196.168
----
Manual Page -- http://www.php.net/manual/en/function.mysql-real-escape-string.php
Edit -- https://master.php.net/note/edit/86759
Del: integrated -- https://master.php.net/note/delete/86759/integrated
Del: useless -- https://master.php.net/note/delete/86759/useless
Del: bad code -- https://master.php.net/note/delete/86759/bad+code
Del: spam -- https://master.php.net/note/delete/86759/spam
Del: non-english -- https://master.php.net/note/delete/86759/non-english
Del: in docs -- https://master.php.net/note/delete/86759/in+docs
Del: other reasons-- https://master.php.net/note/delete/86759
Reject -- https://master.php.net/note/reject/86759
Search -- https://master.php.net/manage/user-notes.php