Hello all,
I am having some problems with my code. I am pulling data from a mysql server but the results are not coming out the way I want it.
I think its my sql statement. I am trying to select any record with a price higher than 2 million.
<?
switch($_GET["which"]) {
case "de":
$which_cat = "`L_proptype`='sfa' OR `L_proptype`='res' AND `L_listpricelow` > '2000000000'";
break;
case "co":
$which_cat = "`L_proptype` = 'sfa' AND `L_listpricelow` < '2000000000' AND `L_ListStatus` = 'act'";
break;
case "ho":
$which_cat = "`L_proptype` = 'res' AND `L_listpricelow` < '2000000000' AND `L_ListStatus` = 'act'";
break;
case "mh":
$which_cat = "`L_proptype` = 'mh' AND `L_ListStatus` = 'act'";
break;
case "ll":
$which_cat = "`L_type` = 'lotland' AND `L_ListStatus` = 'act'";
break;
case "24":
$which_cat = "`L_proptype` = 'ri' AND `L_ListStatus` = 'act'";
break;
}
$sql = "SELECT * FROM `listings` WHERE ".$which_cat." LIMIT 6";
$result = mysql_query($sql) or die ("<b><center style='color:red;'>".mysql_errno().": ".mysql_error()."</b></center>\n");
?>
things is I get records to display but there prices are under 2million which it wrong.
Any help would be great.
DP