Based on http://dev.mysql.com/doc/refman/5.0/en/case-statement.html, I think I have to store my query before I run it. How do I store and then execute it?
My code so far produces and error:
$query = "UPDATE plan SET curacc = case when curacc + 1 >= ddecpt
then 0
else curacc + 1
end,
curwipprice = case when curacc + 1 >= ddecpt
then curwipprice + 1
else curwipprice
end
WHERE id = 'LAMS-ZV90'";
include "connect_to_mysql.php";
echo $query . '<br/>';
mysql_query(" . $query . ") or die(mysql_error());