Jump to content

Results wont display when try ordering them


FUNKAM35

Recommended Posts

if(empty($_GET['order_by']))$order="order by rate3 ASC ";
if($_GET['order_by']=='rate3asc')$order="order by rate3 ASC ";
if($_GET['order_by']=='rate3desc')$order="order by rate3 DESC ";
if($_GET['order_by']=='bedsasc')$order="order by beds ASC ";
if($_GET['order_by']=='bedsdesc')$order="order by beds DESC ";

$select = "SELECT prop_id, agent_id, ref, price, prop_type, town, province, country, location, beds, baths, pool, url, description, image1, rate1, rate2, rate3, currency, ski_area, sleeps, holiday_parks, shortdescription FROM rental WHERE $where LIMIT $from, $max_results ".$order;
echo  "<table width=\"40%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"left\">
<tr><td class=\"norm\" align=\"left\">
<div class=\"styled-select\">
<form id=\"formorder\" action=\"$_SERVER[PHP_SELF]\" method=\"get\">
<select name=\"order_by\" onChange=\"UpdateQty(this)\" >
<option value=\"sort by\" selected=\"selected\">Sort by</option>
<option value=\"rate3asc\">Lowest Price First</option>
<option value=\"rate3desc\">Highest Price First</option>
<option value=\"bedsasc\">Beds (Low to High)</option>
<option value=\"bedsdesc\">Beds (High to Low)</option>
<input type=\"submit\" name=\"submit\" id=\"button\" value=\"go\"> 
</form></div></td><td class=\"norm\" align=\"left\">\n";
if($order_by=="rate3 asc"){
echo"Sorted by Lowest Price First";
}
if($order_by=="rate3 desc"){
echo"Sorted by Highest Price First";
}
if($order_by=="beds asc"){
echo"Sorted by Least Bedrooms First";
}
if($order_by=="beds desc"){
echo"Sorted by Most Bedrooms First";
}
echo"</tr></td></table>\n";
$pic_count=0;
echo  "<table width=\"70%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"position:absolute; margin-top:40px; margin-left:180px; height=100%;\">\n";
if($num_rows = mysql_num_rows($results)==0)
{
echo  "There are no Holiday Homes for Rental in $country Please Visit Again Soon as This Website is Updated Daily";
}
while ($query_data = mysql_fetch_row($results))
{
$prop_id=$query_data[0];

Hi, I am trying to order my results with two parts of code and the results will not display, the same code works on a different website so I don't think its that far off?

 

Many thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.