q is the item # being passed from the form. I would also like to pass a variable for the $row[4], where I can define the [4], [5], [6] or whatever based on the client ID.
My question is 2 fold
1) pass the value via the URL as, for the sake of this discussion c, yielding:
Code: Select all
$c=$_Get["c"];
My PHP code is as follows:
Code: Select all
<?php
$q=$_GET["q"];
$con = mysql_connect('localhost', 'sssss', 'ssss');
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("inventory", $con);
$result=mysql_query("select * from info where item_no ='$q'" );
$row = mysql_fetch_row($result);
if ($row[4] == 'N'){
echo "<font color='red'><td>    Invalid Entry, Item #" .$q. "  is currently not available for you to order, Please verify the item # and try again.</td></font>";
}
elseif ($row[4] == 'Y'){
echo "<td>    Vendor:" . $row[1] . "</td>";
echo "<td>    Description:" . $row[3] . "</td>";
echo "<td>    Cost:" . $row[7] . "</td>";
}
else{echo "<font color='red'><td>    Invalid Entry, Item #" .$q. "  is not currently a valid Item #.</td></font>";}
mysql_close($con);
?>