
<p>
Search the store database:<br />
<form action="ItemDescriptionSearch.php" method="post">
	ItemID:<br />
	<input type="varchar" name="ItemID" size="10" maxlength="32" value="" /><br />
	<input type="submit" value="Search!" />
	</form>
	</p>

<?php

if (isset($_POST['ItemID']))
{

	$linkID = mysql_connect("localhost","root","ktm250") or die("No connection");
	mysql_select_db("newstore") or die("No connection");

	$ItemID = mysql_real_escape_string($_POST['ItemID']);

	$query = "SELECT * FROM itemdescription WHERE ItemID LIKE '%$ItemID%'";

	$result = mysql_query($query);

	$num_rows = mysql_numrows($result);

	$num_fields = mysql_numfields($result);

	for($count = 0; $count < $num_rows; $count++)
	{
		$ItemID = mysql_result($result, $count, "ItemID");
		$Thebrand = mysql_result($result, $count, "Brand");
		$Themodel = mysql_result($result, $count, "Model");
		$Thegender = mysql_result($result, $count, "Gender");
		$wholesale = mysql_result($result, $count, "Wholesale");

		echo "ItemID: $ItemID <br>";
		echo "brand: $Thebrand <br>";
		echo "model: $Themodel <br>";
		echo "gender: $Thegender <br>";
		echo "wholesale: $wholesale <br>";
		echo "<br>";
	}

	mysql_close();
}

?>

<a href="index.html">Return to main...</a>
