Now, I have new problem!!

From: Date: Sun, 22 Jul 2001 02:12:44 +0000
Subject: Now, I have new problem!!
Groups: php.db 
Request: Send a blank email to php-db+get-10635@lists.php.net to get a copy of this message
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

« previous php.db (#10635) next »