Goochi Posted December 9, 2003 Share Posted December 9, 2003 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 Link to comment https://forums.phpfreaks.com/topic/1477-not-updating-an-update/ Share on other sites More sharing options...
shivabharat Posted December 9, 2003 Share Posted December 9, 2003 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. Link to comment https://forums.phpfreaks.com/topic/1477-not-updating-an-update/#findComment-4866 Share on other sites More sharing options...
Goochi Posted December 9, 2003 Author Share Posted December 9, 2003 very choqing.. \"No Database Selected\" :oops: thanks for helping.. very handy the mysql_error.. Link to comment https://forums.phpfreaks.com/topic/1477-not-updating-an-update/#findComment-4867 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.