Forum Moderators: coopster
Why, are you getting specific errors? Use mysql_error() in your query for some help.
$sql = mysql_query("SELECT make, you, size FROM tablename WHERE make ='$carrymake' and location = 'loc' size= '$size and price >= '$miniprice' <= '$maxiprice' LIMIT $from, $max_results") or die(mysql_error());
$sql = mysql_query("SELECT make, you, size FROM tablename WHERE make ='$carrymake' AND location = 'loc' AND size= '$size AND price >= '$miniprice' AND price <= '$maxiprice' LIMIT $from, $max_results") or die(mysql_error());
Try that. Like I say, you were missing some AND clauses. I have capitalized them so you can see.
maybe this is useful to knwo also that its also in conjunction with pagination
so i have two select methods ie
$sql = mysql_query("SELECT make, model, price, year2, app, reg, photodesc, id, size FROM cars WHERE make ='$carrymake' and model ='$carrymodal' and price >=$miniprice and price <=$maxiprice order by price LIMIT $from, $max_results");
THEN
$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM cars WHERE make ='$carrymake' and model ='$carrymodal' and price >=$miniprice and price <=$maxiprice order by price"),0);
$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM cars WHERE make ='$carrymake' and model ='$carrymodal' and price >='$miniprice' and price <='$maxiprice' order by price"),0);
Does this make any difference?
i have sicne removed these if it helps im trying to eliminate possible errors..
this is now my select statment
$sql = mysql_query("SELECT make, model, price, year2, app, reg, photodesc, id, size FROM cars WHERE make ='$carrymake' and model ='$carrymodal' Order BY price LIMIT $from, $max_results");
Whats wrong with this? is it maybe the way im displaying the data ie like this
if(mysql_num_rows($sql) == 0){
print 'Sorry no matches found.';
} else {
while($row = mysql_fetch_array($sql)){
$make = $row['make'];
$model = $row['model'];
$reg = $row['reg'];
$year2 = $row['year2'];
$size = $row['size'];
$tab = '';
$tab .=<<<EOD
<table width='570' border='0'class=setb>
<tr>
<td height=50 width=220 height="130" bgcolor=EDEDED class=sehead><a href="#" onClick="window.open('search2.php?id=$idshow','mywindow','width=560,height=400')">$year2 $aaa $bbb $size</a></td>
<td valign="middle" rowspan="2" bgcolor=EDEDED width="70" class=blackb >$price</td>
</tr>
<tr>
<td width=380 bgcolor=EDEDED class=fs>$ddd <img src="images/$app" alt="" border="0"><br><br></td>
</tr>
</table>
EOD;
print $tab;
}