Embedded quotes
Posted: Wed Oct 08, 2008 5:09 am
I am using PHp to insert data into a mysql table. as follows
$query = "INSERT INTO database (category, catname, active) VALUES('$category', '$catname', '$active' ) ";
The problem is if the variable catname contains quotes (for example - LAST YEAR'S STOCK -) I get mysql errors.
Any suggestions?
$query = "INSERT INTO database (category, catname, active) VALUES('$category', '$catname', '$active' ) ";
The problem is if the variable catname contains quotes (for example - LAST YEAR'S STOCK -) I get mysql errors.
Any suggestions?