Tell me, how can I implement a search by parameter? For example, if a user entered only a name, then searched by name, if he chose a city, then a city was added to the search query. Tell me how you can make a part where there is a choice: the city entered, it means that it also searches around the city, did not enter it, it means that it searches only by name, entered age, searches around the city, name and age, did not enter ... well etc. Is there any tutorial, please tell me? I want to make out and do.

    1 answer 1

    Here, read the topic there are several options for solving this problem.

    Organization of search in the database on the parameters entered in the form

    <? // Создаем класс $select = new Zend_Db_Table; // Cоздаем SQL, тут SELECT * FROM table_name ... $query = $this->getAdapter()->select()->from('table_name', '*'); if (isset($POST['что угодно'])) { $query->where('что угодно = ?', $POST['что угодно']); // И так хоть сто раз } $result = $select->fetchAll($query); ?> 
    • And how is it possible for the request to be constantly transferred to the database? Here is an example of processing, and how to implement a constant transfer? - OverLoader