mattm1712 Posted December 10, 2011 Share Posted December 10, 2011 $set = mysql_query("UPDATE comments SET matserviewed='yes' WHERE threadid='$t' AND matserviewed='no' AND originalpostby='$username'"); is there any reason why this wont work?? Quote Link to comment https://forums.phpfreaks.com/topic/252911-query-help/ Share on other sites More sharing options...
jj20051 Posted December 10, 2011 Share Posted December 10, 2011 What is your database structure? Try this: $set = mysql_query("UPDATE comments SET matserviewed='yes' WHERE threadid='$t' AND matserviewed='no' AND originalpostby='$username'") or die(mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/252911-query-help/#findComment-1296644 Share on other sites More sharing options...
xyph Posted December 10, 2011 Share Posted December 10, 2011 Many reasons. Since the query contains variables that are unknown to us, it could be values that contain quotes. Since we don't know your table structure, it could be a typo in a column name. Since we don't have any sample data, it could be that no value meets the all the WHERE clause requirements. echo'ing mysql_error might help you solve this issue. Quote Link to comment https://forums.phpfreaks.com/topic/252911-query-help/#findComment-1296645 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.