I've searched through what "I think I should be searching for" - but not really understanding or getting anywhere, please could someone point me in the right direction?
I'd like to be able to filter a result set using the th of one column (region) and although I tried the w3cs tutorial I ended up confusing myself as to "what bit of code goes where" etc and the dropdown form thingie looked very clunky.
All advice and help most welcome.
This is my example website, myTrader clicking the All Trade Regions link on the left displays as far as I've got & that took me days of cobbling tutorials and guddling about in the dark.
query.php code so far:
<table id="mainTable">
<tr><td width="300" valign="top"><H1>Welcome to myTrader!</H1>
<span class="mainText">Glass & Paper Recycled Commodities Trading Site</span></td>
<td valign="top" align="right"><img src="images/largeLogo.jpg" width="406" height="113" border="0"></td></tr></table>
<P><span class="paraHeadingOne">All Region Paper Sales</span> </P>
<P>
<table class="dbTable">
<tr>
<tr><th>Commodity</th> <th>Region</th> <th>Member</th> <th>Size</th> <th>Price</th> <th>Date Posted</th>
</tr>
<?php
$link = mysql_connect('localhost', 'palegall', '******');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
$db_selected = mysql_select_db('palegall_newTrader', $link);
if (!$db_selected) {
die ('cant find newTrader' . mysql_error());
}
$query = mysql_query ("SELECT * FROM `sell` WHERE `commodity`='Paper' ORDER BY `price`") or die( mysql_error() );
$row=mysql_fetch_assoc($query);
do
{
echo'<table class="dbTable">';
echo '<tr><td>'.$row['commodity'].'</td>
<td>'.$row['region'].'</td>
<td>'.$row['member'].'</td>
<td>'.$row['size'].'</td>
<td>'.$row['price'].'</td>
<td>'.$row['posted'].'</td>
</tr>';
}while($row=mysql_fetch_assoc($query));
echo "</table>";
?>
</td></tr></table>
</td></tr></table>
</body></html>