Hi.
I am trying to get results from a mysql db to print seperately, each as a link, which when clicked will sort the results of another query. I have the first results printing out (manufacturer) and have made each a link, but when i click on any one of them, the results of the second query are always the same - it prints out the alphabetically last set of data from the table. Here is the code:
$query = "select DISTINCT manufacturer from product_status ORDER BY manufacturer ASC";
$result = mysql_query($query);
$num_results = mysql_num_rows($result);
for ($i=0; $i <$num_results; $i++)
{
$row = mysql_fetch_array($result);
$myvarm = $row["manufacturer"];
echo "<font face='Verdana' size='2'><a href=\"admin.php?view=$myvarm\">$myvarm";
echo"</a>";
echo " | ";
}
$query = "SELECT product_id,manufacturer,product_name,product_price,product_sku,shipping,stock_status,stock_comment FROM product_status WHERE manufacturer='$myvarm' ORDER BY manufacturer ASC";
$result = mysql_query($query) or die("Query failed miserably");
print "<br><br><font face='Verdana' size='1'>SORT BY: <br><br>";
and then it has some more print formatting for the results which I didn't include here.
Any ideas? Thanks.