Another error... looks like some strings need escaping...
('+king's* +canyon* ') needs to be ('+king\'s* +canyon* ')
Code:
Database error in vBulletin 4.2.0:
Invalid SQL:
SELECT
*,
gc.catname,
MATCH (gi.title, gi.text, gi.tagging, gi.username) AGAINST ('+king's* +canyon* ')
AS relevance,
u.username,
ga.hidden,
ga.title as albumname
FROM dbtech_gallery_images gi
LEFT JOIN dbtech_gallery_categories gc ON gi.catid = gc.catid
LEFT JOIN dbtech_gallery_albums ga ON gi.albumid = ga.albumid
LEFT JOIN user u ON gi.userid = u.userid
WHERE
((gi.albumid = 0) || ((ga.hidden = 0) && (ga.password = '')) || (gi.userid = 0)) &&
gi.instanceid = 1 &&
gi.approved = 1 &&
gi.deleted = 0 &&
MATCH
(gi.title, gi.text, gi.tagging, gi.username)
AGAINST
('+king's* +canyon* ' IN BOOLEAN MODE)
ORDER BY
relevance DESC
LIMIT
0, 14;
MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's* +canyon* ')
AS relevance,
u.username,
ga.hidden,
ga.ti' at line 4
Error Number : 1064
Request Date : Friday, October 26th 2012 @ 07:40:58 PM
FIX: dbtech/gallery/modules/gallery/functions/class_module.php in public static function fetch_display_images
PHP Code:
$boolean_query = "('";
for($i=0; $i < count($query_array); $i++)
{
$boolean_query .= '+' . self::$vbulletin->db->escape_string($query_array[$i]) . '* ';
}
$select_query = "MATCH (gi.title, gi.text, gi.tagging, gi.username) AGAINST " . $boolean_query . "')";
$boolean_query .= "' IN BOOLEAN MODE)";