Jump to content

Archived

This topic is now archived and is closed to further replies.

Goochi

not updating an update

Recommended Posts

I got following code at my fanlisting-script..

$query = \\\"UPDATE fanlisting SET censor = \'n\' WHERE id = \'$uncensor\'\\\"; mysql_query ( $query ); echo $query . \'<br>\';

 

this should modify a record in the datebase + output the SQL-code to the screen with the echo. The output to the screen is

UPDATE fanlisting SET censor = \'n\' WHERE id = \'50\'

 

but in the DB isn\'t happening anything.. while when I copy the output that appears on the screen (second quote) and I paste it in my phpMyAdmin then it does update the record.

 

What might cause this ?

thanks

Share this post


Link to post
Share on other sites

Try this

 

$query = "UPDATE fanlisting SET censor = \'n\' WHERE id = \'$uncensor\'"; mysql_query($query) or die(mysql_error());

echo $query.\'<br>\';

 

see if you get any error when you execute this. I have added mysql_error() which will report if there is any error.

Share this post


Link to post
Share on other sites

very choqing.. \"No Database Selected\" :oops:

thanks for helping.. very handy the mysql_error..

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.