...

View Full Version : real escape string



timgolding
07-04-2007, 03:00 PM
How can i add a escape string to this php mysql query



mysql_query('insert into times (code, date, time, duration) values ("'.$course_code.'","'.$date_inSQL.'","'.$time_inSQL.'","'.$duration.'" )');

Fumigator
07-04-2007, 05:08 PM
Wrap each variable with mysql_real_escape_string()

timgolding
07-09-2007, 10:51 AM
Any chance of an example?
Do you mean like this?



mysql_query('insert into times (code, date, time, duration) values ("'.mysql_real_escape_string($course_code).'","'.mysql_real_escape_string($date_inSQL).'","'.mysql_real_escape_string($time_inSQL).'","'.mysql_real_escape_string($duration).'" )');

StupidRalph
07-09-2007, 10:54 AM
mysql_query('insert into times (code, date, time, duration) values ("'.mysql_real_escape_string($course_code).'","'.mysql_real_escape_string($date_inSQL).'","'.mysql_real_escape_string($time_inSQL).'","'.mysql_real_escape_string($duration).'" )');

timgolding
07-09-2007, 11:30 AM
hehe thats funny



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum