finder
| From: | Emiliano Boragina | Date: | Fri, 17 Jul 2009 03:34:13 +0000 |
| Subject: | finder | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-46327@lists.php.net to get a copy of this message | ||
Hello
hello
and hello everyone
I am sorry again to disturb this. Ive got this from a web:
$sql = "SELECT buildings.*, city.* FROM buildings, city WHERE
buildings.idcity = city.id ";
if (isset($_POST['txtSearch']))
{
$sql .= " AND buildings.title LIKE '%" . $_POST['txtSearch'] .
"%' ";
if (intval($_POST['selCity']) > 0)
{
$sql .= " AND buildings.idcity = '" . intval($_POST['selCity']) .
"'";
}
}
$sql .= " ORDER BY city.name ASC";
$result = mysql_query($sql);
I dont understand if the second IF plus with the first IF or what, it means
the search is on buildings and city?
If I want to search more than one option I must tu add an IF like the
example for each extra option I want?
Thanks a lot... And sorry all this...
+ _
// Emiliano Boragina _
// Diseño & Comunicación //////////////////
+ _
// emiliano.boragina@gmail.com /
// 15 40 58 60 02 ///////////////////////////
+ _