I need the correct syntax for the following. The following works (it correctly searches and retrieves the term for searching), but I know there is a shorter way to write the WHERE clause to search the three columns:
This short form does not work:PHP Code:$searchtext = $_POST['searchtext'];
if ($searchtext != '') { // Some search text was specified
$where .= " AND vehicle_name LIKE '%$searchtext%' OR owner_name LIKE '%$searchtext%' OR descr LIKE '%$searchtext%'";
}
This doesn't work either:PHP Code:AND vehicle_name, OR owner_name, OR descr LIKE '%$searchtext%'";
The basic code comes from page 127 of Kevin's Build Your Own DB Driven Website book.PHP Code:AND vehicle_name, owner_name, descr LIKE '%$searchtext%'";
Thanks!
Steve








Bookmarks