i have been trying for a while to get dynamic sorting of my php results, but for somereason, it just doesn't do anything, if i try to change the sort fields in the dropdown, nothing happens and i can't figure it out.
Here is the php code
$sortorder = "ASC";
$sortfield = "addon_name";
if(isset($_GET["sortorder"])) {
$sortorder = $_GET["sortorder"];
}
if(isset($_GET["sortfield"])) {
$sortfield= $_GET["sortfield"];
}
$small_statement = "`addons` WHERE addon_size='small' ORDER BY $sortfield $sortorder";
AND here is the html code
<select name="sortorder" onChange="MM_jumpMenu('parent',this,0)">
<option value="?sortorder=ASC">Ascending</option>
<option value="?sortorder=DSC">Descending</option>
</select>
<select name="sortfield" onChange="MM_jumpMenu('parent',this,0)">
<option value="?sortfield=addon_name">Name</option>
<option value="?sortfield=addon_rank">Rank</option>
</select></div><!---end browse_header--->
<div id="small" class="tab_content">
<?php
$browse_small_query = mysql_query("SELECT * FROM {$small_statement} LIMIT {$startpoint_small} , {$limit}");
while($row_small = mysql_fetch_assoc($browse_small_query)) : ?>
<?php extract($row_small);?>
<div class="addon_wrapper" onclick="location.href='addon_detail.php?eid=<?php print "$estate_id";?> &aid=<?php print "$addon_id";?>';"><div class="addon_header"><?php print "$addon_name";?><?php print "$addon_id";?></div><!---end addon_wrapper---><div class="addon_browse_image"></div><!---end addon_browse_image---></div><!---end addon_wrapper--->
<?php endwhile ?>
Thanks for any and all help