I've never done an if in a mysql query. Based on: http://dev.mysql.com/doc/refman/5.0/en/if-statement.htmlI came up with this, but no joy.
mysql_query("UPDATE skew_trkg_slave IF observations_needed = observations_completed THEN SET minor_cycle_completed = '1'; WHERE " . $skew_trkg_slave_where . "") or die(mysql_error());
How close am I?
SET minor_cycle_completed = 1
<font color='"#0000FF"'>WHERE observations_needed = observations_completed
Thank you very much r937. Could that have been done with a if statement? If so, how would it be written the the procedural style?
no, because an IF statement is used for flow-of-control execution, not to evaluate column contents in each row
Thanks again r937. I'll look into flow-of-control execution. It sounds like something I should at least know about.