lets say I have this query:
mysql_query("UPDATE results_tb SET num_unmarked - 1 WHERE user_id = $student AND test_id = $test AND item_id = $item")
is there a way within mysql to essentially do an IF statement which checks that if num_unmarked will be 0 after it is decremented. if it is 0 I want to update another field basically.
kinda like IF( num_unmarked == 0 ) SET is_final = ‘YES’…
just curious if there are ways to do it rather than querying and checking the value if you see where I am coming from. I am rather inexperienced with MySQL.
many thanks,
Sure you can