View Full Version : search error
When performing a search with either single or multiple selection menu it gives following error:
Database error in vBulletin 3.7.1:
Invalid SQL:
SELECT links.linkid
FROM forumadv_links AS links
LEFT JOIN forumadv_links_cfields_entries AS customfields ON (links.linkid = customfields.lid)
WHERE (field15 IN('234234') AND ) AND valid = 1
LIMIT 500;
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 ') AND valid = 1
LIMIT 500' at line 5
Error Number : 1064
Brian
05-31-2008, 04:47 PM
Thank you for pointing this out. I've applied the fix to the download package here, so if you will download the files again and replace your current links/search.php file with the updated version, that should take care of the issue.
Or, if you would like to apply the fix manually, just look in the file for this line:
$condition .= ($strcount ? ' (' : '(') . $cfieldandstring . ' AND ';
And replace with this:
$condition .= iif($condition, ') AND ') . ' (' . $cfieldandstring;
Works now! Thank you.... :)
surfdude
06-02-2008, 03:15 PM
This did not fix my problem since I have same message as one in the first post. I have first made manual changes to searc.php as suggested and have then downloaded lates package and still no joy.
This is the message I receive:
Database error in vBulletin 3.7.0:
Invalid SQL:
SELECT links.linkid
FROM adv_links AS links
WHERE links.name LIKE '% errant %' OR keywords LIKE '% errant %' OR description LIKE '% errant %') AND valid = 1
LIMIT 500;
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 ') AND valid = 1
LIMIT 500' at line 5
Error Number : 1064
Request Date : Monday, June 2nd 2008 @ 01:11:48 PM
Error Date : Monday, June 2nd 2008 @ 01:11:48 PM
Script : http://www.xxxxxxxxxxxx.co.uk/links/search.php
Referrer : http://www.xxxxxxxxxxxx.co.uk/links/search.php
IP Address : xx.xxx.xxx.xxx
Username : xxxxxxxxxx
Classname : vb_database
MySQL Version : 4.1.20
Brian
06-02-2008, 03:36 PM
Thanks for pointing this one out as well. Looks like there's a small issue that can occur if you have full text searching disabled in your vB options. I've just applied the fix to the links/search.php file in the download package here, so if you will download the files again and upload the updated version over your current one, that should take care of the issue.
Or if you would rather apply the fix manually just look in the file for this line:
foreach ($searchwords AS $sstring)
And Add this just Above:
if (!$vbulletin->options['fulltextsearch'])
{
$condition .= '(';
}
surfdude
06-02-2008, 05:18 PM
That worked.
Your forum is currently using the vBulletin search engine.
To enable the MySQL Fulltext search, we will issue the following two queries...
Thank you.
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.