This question has already been answered:
Good afternoon, I will try to paint the problem in as much detail as possible. I have a table. Apartment with fields (rooms, floor, area, price, city). I do a sample of the database on the page
echo GetNav($p, $num_pages); $sel = "SELECT * FROM `kvartiri` LIMIT ".$start.", ".$num_elements; $query = mysql_query($sel); if(mysql_num_rows($query)>0){ ?> <table border="1" cellpadding="15"> <tr> <th>ID</th> <th>Login</th> <th>Email</th> </tr> <?php while($res = mysql_fetch_array($query)){ echo '<tr><td>'.$res['avtor'].'</td>'; echo '<td>'.$res['telephon'].'</td>'; echo '<td>'.$res['etaj'].'</td></tr>'; } ?> </table> There is a form on the page. On form input'y. Number of rooms, price, city and FIND BUTTON. I think you understand what I mean. So, how can I shovel the request. I understand with several conditions, but I actually have a problem, and if one of the values is not entered, for example, the fields are filled with the number of rooms, the price, and the city remained empty. Then in where gorod=$gorod would be incorrect.
How to solve a problem?