paulman888888 Posted January 5, 2009 Share Posted January 5, 2009 Hello; I keep getting this error MySql Error Which is not really an error because it doesnt tell whats wrong. Here's my code $check=mysql_query("UPDATE chess_events SET delete='$delete' WHERE id='" . mysql_real_escape_string($id) . "' ")or die(mysql_error); Please can you tell me what i have done wrong and why MySql Doesn't Give Me An Error! Thankyou Paul Link to comment https://forums.phpfreaks.com/topic/139548-simple-mysql-query-not-working-please-help/ Share on other sites More sharing options...
rhodesa Posted January 5, 2009 Share Posted January 5, 2009 your error checking is wrong...it should be: $check=mysql_query("UPDATE chess_events SET delete='$delete' WHERE id='" . mysql_real_escape_string($id) . "' ")or die(mysql_error()); but the problem is with your field "delete". delete is a reserved word, and it's bad practice to use it as a field name. if you can, change it (maybe use 'removed' instead). if you can change it, use backticks to escape it: $check=mysql_query("UPDATE chess_events SET `delete`='$delete' WHERE id='" . mysql_real_escape_string($id) . "' ")or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/139548-simple-mysql-query-not-working-please-help/#findComment-729976 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.