Jump to content

[SOLVED] Whats wrong with this query?


emma57573

Recommended Posts

In trying to enter the word 'closed' in the status field in my_table if the quantity field = 0

Now this statement is entering the word 'closed' no matter if the quantity is 0 or 5!

Im not sure where im going wrong Ive tried =="0" =='0' and It then stops entering the word altogether.

 


$srt=mysql_query("SELECT * FROM my_table WHERE id=$id");

if ($srt["quantity"]==0){
$sql= "UPDATE my_table SET status='closed' WHERE id=$id";
mysql_query($sql);
}

Link to comment
https://forums.phpfreaks.com/topic/118216-solved-whats-wrong-with-this-query/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.