-> rentAweek,

rL> In my PHP script I have coded e.g.:

rL> $sql = "INSERT INTO `$owners` ( `FirstName`, `LastName`) VALUES ( 
rL> '$firstname' , '$lastname' )";

rL> $result = mysql_query($sql);

rL> So along comes e.g. John O'Groats and nothing gets inserted into the 
rL> database.

rL> OK, I can bypass my oversight by stripping out apostophes from the 
rL> variable values. There has to be a better way please.

Why not just use addslashes() (mysql_escape_string()) & check if $result==true?


Yours, L0vCh1Y


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to