e.g if type was slr i would need the links to change to page?type=slr&srt=price
at the moment they would remain to be page?type=digital&srt=price
help much appreciated thanks
Code: Select all
<?php echo "<table width="960" class="dbtbl" cellpadding="0" cellspacing="0">";
$srt = $_GET['srt'];
$type = $_GET['type'];
$result = mysql_query("SELECT * FROM prod where prodType LIKE '$type' ORDER BY '$srt' ASC") or die(mysql_error());
$num_rows = mysql_num_rows($result);
for ($i = $i; $i <= $num_rows; $i++) {
while ($u = mysql_fetch_array($result)) {
extract($u);
$f_price = number_format($price,2);
echo"<tr class="menuright">\n
<td width="100"><center><img src="$pic"></center></td>\n
<td width="130" ><center>$prodType<a href="{$_SERVER['SCRIPT_NAME']}?srt=prodType"prodtype</a>></center></td>\n
<td width="130" ><center>$manufacturer<a href="{$_SERVER['SCRIPT_NAME']}?srt=manufacturer">manufacturer</a></center></td>\n
<td width="150" ><center>$prodName<a href="{$_SERVER['SCRIPT_NAME']}?type=digital&srt=prodName">prodname</a></center></td>\n
<td width="250" ><center>$prodDescription</td>\n
<td width="100" ><center>£$f_price<a href="{$_SERVER['SCRIPT_NAME']}?type=digital&srt=price">price</a></center></td>\n
<td width="100" ><center>$stock</center></td>\n
</tr>\n";