Page 1 of 1

update longtext

Posted: Sat Mar 15, 2003 10:59 am
by bornycoy
The query works only for a short sentences but when it's a long text it refuses to update. The field type is longtext.
Who can help me????
I am using it on 2 servers and on one it works and the other doesn't ???

$query = "UPDATE $usertable SET Code='$Code',Comment='$Comment'WHERE id='$id' ";

Posted: Sat Mar 15, 2003 11:59 am
by JPlush76
are you adding slashes to the comment field?

addslashes($field)

the one server might have magic quotes turned on and the other server may have it disabled.

if you haven't try

$comment = addslashes($comment);

before you enter it into the database

Thanks Jim

Posted: Sat Mar 15, 2003 1:40 pm
by bornycoy
Thank you Jim
$comment = addslashes($comment);
this works perfect!!

Posted: Sat Mar 15, 2003 2:43 pm
by JPlush76
glad I could help :)