I am trying to figure out how to read data base(Mysql) with rows of item
number (item) and quantity, so that when item number was given, it searched
for the quantity of the item number.
If the quantity number is 0 or less, it will show "Out of Stock", else will
show "In Stock" on my web page.
Here is part of language that I wrote and didn't work.
Please help me what to do,

$result = mysql_query("SELECT * FROM inventory",$link);

  $itemx = "699"
  $quantity = "select quantity from inventory where item = $itemx";
  IF ($quantity <= 0)
  {
   echo "<b>Out of Stock</b>"
  } else {
   echo "<b>In Stock!<b>"
  }

    mysql_close($link);


Thanks for your time.
Tony



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to