nichemtktg — 2011-12-22T21:35:04-05:00 — #1
I've never done an if in a mysql query. Based on: http://dev.mysql.com/doc/refman/5.0/en/if-statement.html
I 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?
r937 — 2011-12-22T21:43:39-05:00 — #2
SET minor_cycle_completed = 1
<font color='"#0000FF"'>WHERE observations_needed = observations_completed
nichemtktg — 2011-12-22T22:01:05-05:00 — #3
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?
r937 — 2011-12-22T22:33:54-05:00 — #4
no, because an IF statement is used for flow-of-control execution, not to evaluate column contents in each row
nichemtktg — 2011-12-22T22:40:36-05:00 — #5
Thanks again r937. I'll look into flow-of-control execution. It sounds like something I should at least know about.