Live Search 1.0 (AJAX) Specific Code

hoangminh said:
If your database uses prefix, then this script will cause DB Error

To fix, at line 23


Change to:
PHP:
    $results = $db->query_read("SELECT * FROM ". TABLE_PREFIX ."thread WHERE `title` LIKE '%$query%' AND `". TABLE_PREFIX ."thread`.`forumid` NOT IN (0 $excludelist)");

There is the quote that it says.
 
coderphp said:
edit ajax_search.php file
search for:
Code:
$results = $db->query_read("SELECT * FROM ". TABLE_PREFIX ."thread WHERE `title` LIKE '%$query%' AND `thread`.`forumid` NOT IN (0 $excludelist)");
replace with:
Code:
$results = $db->query_read("SELECT * FROM ". TABLE_PREFIX ."thread WHERE `title` LIKE '%$query%' AND `thread`.`forumid` NOT IN (0 $excludelist) ORDER BY `lastpost` DESC");


good to head that

There you go. Enjoy.
 
Back
Top