Re: Use of ' and " (quotes)
| From: | Joseph Hadinata | Date: | Thu, 14 Dec 2000 08:30:49 +0000 |
| Subject: | Re: Use of ' and " (quotes) | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-5239@lists.php.net to get a copy of this message | ||
Actually PHP automatically add backslashes before charaacters that need to
be quoted in form variables. But try this: Use AddSlashes function:
$var = AddSlashes($var);
and then:
mssql_query("... '$var' ...", $db);
You can read more about AddSlashes function at
http://www.php.net/manual/function.addslashes.php
Best regards,
Joseph Hadinata
BlueChillies Download Destination
http://BlueChillies.com
--- ORINAL MESSAGE ---
Hi--
When a user enters either a single quote (') or a double quote ("), and I
send it to my MSSQL table, sometimes I get an error message as "an
incorrect syntax" or "query failed".
I need to let users enter those characters.
How can I handle single and double quotes on PHP?
Thanks!