Place Holders

A

Anonymous

Guest
' and " can be valid data, so long as they are properly escaped.
For example, if you wanted to insert the word you're you would have to insert you\'re. Eg.
INSERT INTO table VALUES('you\'re');

To escape your strings in PHP use the addslashes function:
Code:
<?
	$before = "you're";
	$after = addslashes($before);
?>
You should be able to insert $after without any errors. Try echoing $before and $after to see the difference.

Hope this helps!
 
Back
Top