View Single Post
Old 07-11-07, 03:41 PM   #5
evilghost
Registered User
 
Join Date: Jul 2005
Posts: 3,606
Default Re: Storing Javascript into MYSQL

Your Javascript likely contains ' (single tick) and as a result it's getting munged in your SQL because you're using the single tick. You need to escape the input so single tick is interpreted as part of the query data itself and not the actual query construct.

mysql_real_escape_string() should do the trick and hopefully fix your issues, http://us.php.net/manual/en/function...ape-string.php

goodstats = '".mysql_real_escape_string($this->goodstats)."'

Also, don't use varchar, use BLOB, MEDIUMBLOB, or TINYBLOB.
evilghost is offline   Reply With Quote