You are here: Re: any way to avoid millions of 'if' args??? please. « PHP Language « IT news, forums, messages
Re: any way to avoid millions of 'if' args??? please.

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация