I can select everything from my db but i want to select everything that has a condition (which is a field in the table) of new or used but seemingly am doing something wrong:
$query = "SELECT * FROM caravandb WHERE condition='New' OR condition='Used' ORDER BY price DESC";
Anyone able to shed light on where i am going wrong?
$caravanquery = "SELECT * FROM caravandb WHERE condition = 'New' OR condition = 'Used' ORDER BY price DESC";
$caravanresult = mysql_query($caravanquery);
while($row = mysql_fetch_array($caravanresult)){
echo "<td width='280' align='center' class='model'>";
echo $row['make'] . " " . $row['model'] . " " . $row['year'];
echo "</td><td width='100'>";
echo "<ul>" . "<li>" . $row['berth'] . " Berth</li>" . "<li>MTPLM: " . $row['mtplm'] . "Kg</li>" . "</ul></td>";
echo "<td width='60' align='center' class='price'>";
echo "<span>" . $row['oldprice'] . "</span>" . "<br />£" . substr($row['price'], 0, -3) . ',' . substr($row['price'], -3);
echo "</td><td width='200' align='right' class='layout'>";
echo "<img src='layouts/".$row['ref'].".gif'>";
echo "</td></tr>";
}