O'Reilly logo

Sphinx Search by Abbas Ali

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - creating the form to add property

  1. Create a file /path/to/webroot/properties/add.php with the following content:
    <?php /** * File: /path/to/webroot/properties/add.php */ include('init.php'); // Get the list of cities $query = "SELECT id, name FROM cities"; foreach ($dbh->query($query) as $row) { $viewVars['cities'][$row['id']] = $row['name']; } // Get the list of localities $query = "SELECT id, name FROM localities"; foreach ($dbh->query($query) as $row) { $viewVars['localities'][$row['id']] = $row['name']; } // Get the list of amenities $query = "SELECT id, name FROM amenities"; foreach ($dbh->query($query) as $row) { $viewVars['amenities'][$row['id']] = $row['name']; } // If form is submitted then save the data // We aren't doing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required