My server has a cgi-local bin, where all of my cgi scripts have to be stored
in there.
When I input the script into my regular html pages, it doesn't work.
This is the script that I am using and saved as inventory.php,

<?php
    $link = mysql_connect("xxxx","xxxxx","xxxxx")
        or die ("Could not connect");

 if (! @mysql_select_db("xxxxx") )

 echo( "<P>Unable to locate the inventory " .
  "database at this time.</P>" );
  exit();}

  $itemx = "9846";
  $sql = "SELECT quantity FROM inventory WHERE item = '$itemx'";
  $result = mysql_query($sql,$link);
  $row = mysql_fetch_array($result);
  $num = $row["quantity"];

  if ($num < 1) {
  echo "<b><font color=\"#FF0000\">Out of Stock</font></b>";
  } else {
  echo "<b><font color=\"#0000FF\">In Stock</font></b>";
  }

  mysql_close($link);
?>

How can I connect from my html page with known value of $itemx = "xxxx" to
this scrip(inventory.php), and get result back on to my html page with words
"In Stock" or "Out of Stock"?
Can anybody help me please?
Thanks for your time again.
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