Justtechjobs.com Find a programming school near you






Online Campus Both


php-db | 2000121

[PHP-DB] Re: Use of ' and " (quotes) From: Joseph Hadinata (joseph <email protected>)
Date: 12/14/00

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!

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe <email protected>
For additional commands, e-mail: php-db-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>