|
Posted by Peter Butler on 11/21/49 11:22
Geoff Berrow <blthecat@ckdog.co.uk> wrote in message
> What would a typical query look like from these ten variables?
nb: I have used the value of 'a' as being equal to default or unset or
'search all' *// I am thinking of changing this to NULL instead.
OK here's a chunk of actual code.
line 194 => 207 file: result.php
=========================begin:
elseif ($district!=a && $ward==a && $estatename==a && $category==a &&
$style==a && $substyle==a && $varietal!=a && !$vintage && !$vintage_a &&
!$vintage_b && $award==a && !$price_a && !$price_b)
echo"show all wine estates from $district that cultivate $varietal vines
";
$query = "SELECT DISTINCT `estatename`, `code`, `tel`, `email`, `region`,
`owner` FROM `estates` WHERE `$district`='$district' AND `$varietal` =
'$varietal' AND `serve`='y' ORDER BY `estatename` ASC";
$result = mysql_db_query($db, $query, $connection) or die("Error in
query");
$x=0;
while ($myrow = mysql_fetch_row($result))
{
$x++;
echo"<tr bgcolor=`#B8F8B6`><td><a
href=\"details.php?id=$myrow[0]\">$myrow[0]</a></td><td>$myrow[1]-$myrow[2]<
/td><td>$myrow[4]</td><td><a
href='mailto:$myrow[3]'>$myrow[3]</a></td></tr>" ;
$myrow = mysql_fetch_row($result);
echo"<tr bgcolor=`#F0F385`><td><a
href=\"details.php?id=$myrow[0]\">$myrow[0]</a></td><td>$myrow[1]-$myrow[2]<
/td><td>$myrow[4]</td><td><a
href='mailto:$myrow[3]'>$myrow[3]</a></td></tr>" ;
}
}
Navigation:
[Reply to this message]
|