finder

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello? hello? and hello everyone?

 

I am sorry again to disturb this. I?ve 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@xxxxxxxxx  /
   // 15 40 58 60 02 ///////////////////////////
+                                                                          _

 


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux