Could you take a look at this code for me please and see if you can spot anything wrong. I'm guessing my syntax is incorrect somehow because if I use just one variable it works fine - it is when I try to put the AND bit in the query (or maybe where i echo the rows?). If the page URL looks like this:
...whatever.php?priceband_id=1&area_id=1
then i am trying to $_GET the two values to interrogate the 'stuff' database table. The database table/column names are all correct. Can you see anything is obviously wrong? I just get a blank page.
<?php
require_once ('mysql_connect.php');
if (isset($_GET['priceband_id']) && isset($_GET['area_id'])) {
$priceband_id=$_GET['priceband_id'];
$area_id=$_GET['area_id'];
$sql = mysql_query("SELECT * FROM stuff WHERE priceband_id=".$priceband_id" AND area_id='.$area_id'") or die (mysql_error());
$result = $sql;
while($row=mysql_fetch_array($result)) {
echo "'.$row['price'].'"<br />;
echo "'.$row['area'].'";
<br />
}
}
?>
Thanks!