note 29820 added to function.mysql-query

From: Date: Wed, 26 Feb 2003 04:05:29 +0000
Subject: note 29820 added to function.mysql-query
Groups: php.notes 
Request: Send a blank email to php-notes+get-44531@lists.php.net to get a copy of this message
this is rather obvious, but it gave me a lot of pain, so I'll post it here. mysql does not understand single quotes (') or backslashes (\) in queries, so if you need to add something containing these signs to a mysql database, use urlencode : $foo = "jimmy's chicken shack"; $foo = urlencode($foo); -- http://www.php.net/manual/en/function.mysql-query.php http://master.php.net/manage/user-notes.php?action=edit+29820 http://master.php.net/manage/user-notes.php?action=delete+29820 http://master.php.net/manage/user-notes.php?action=reject+29820

« previous php.notes (#44531) next »