update longtext

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bornycoy
Forum Newbie
Posts: 2
Joined: Sat Mar 15, 2003 10:59 am
Location: cyprus

update longtext

Post 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' ";
JPlush76
Forum Regular
Posts: 819
Joined: Thu Aug 01, 2002 5:42 pm
Location: Los Angeles, CA
Contact:

Post 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
bornycoy
Forum Newbie
Posts: 2
Joined: Sat Mar 15, 2003 10:59 am
Location: cyprus

Thanks Jim

Post by bornycoy »

Thank you Jim
$comment = addslashes($comment);
this works perfect!!
JPlush76
Forum Regular
Posts: 819
Joined: Thu Aug 01, 2002 5:42 pm
Location: Los Angeles, CA
Contact:

Post by JPlush76 »

glad I could help :)
Post Reply