ฉันจะเขียนคำสั่ง IF ELSE ในแบบสอบถาม MySQL ได้อย่างไร
สิ่งนี้:
mysql_query("...(irrelevant code).. IF(action==2&&state==0){state=1}");
จากนั้นลงในอาร์เรย์ของฉันฉันควรจะทำได้:
$row['state']
//this should equal 1, the query should not change anything in the database,
//just the variable for returning the information