Hi all,
I need some advice to solve the following problem:
<?php
$cx=odbc_connect (\"USERS\", \"\", \"\");
$qry=\"UPDATE USERS
SET title = \'$title\'
WHERE id = $id\";
$success=odbc_exec($cx,$qry);
?>
The above query fails if $title contains \' (single quote)
eg. \"Tom\'s CookBook\".
So how can I store the \"\'\" into the database?
I tried to change the query to:
$qry=\"UPDATE USERS
SET title = \\"$title\\"
WHERE id = $id\";
Still cannot work.
Please advise. Thanks. 🙁