Query not formatted correctly?
I hope all who celebrated had a good Easter.
I am trying to update some records in MySQL, but am not getting the result I want.
It seems to be finding the correct records that meet the WHERE and OR clause, but I only want to update records where "issuecreated" is equal to No. It is updating all records it finds where the first two parameters are met.
$query=("UPDATE bridges SET issuecreated = 'New' WHERE onlysignal<=-83 OR CCQ<=89 AND issuecreated == 'No'");
I imagine the problem lies in my last criteria, but cannot seem to fix this.
You don't need double equals to compare, just one will do. Also, I grouped your OR conditions so the AND will be used in both cases:
$query = ("UPDATE bridges SET issuecreated = 'New' WHERE (onlysignal<=-83 OR CCQ<=89) AND issuecreated = 'No'");
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)