PDA

View Full Version : Links Directory - Database Error When Searching


grahamsmythe
08-25-2008, 01:48 PM
Any idea what this error means?

---------------------------------------------------

Database error in vBulletin 3.7.2:

Invalid SQL:

SELECT links.linkid
FROM adv_links AS links


WHERE (links.name LIKE '%norvin %' OR keywords LIKE '%norvin %' OR description LIKE '%norvin %' OR posts.pagetext LIKE '%norvin %' AND links.name LIKE '%centre %' OR keywords LIKE '%centre %' OR description LIKE '%centre %' OR posts.pagetext LIKE '%centre %') AND valid = 1
LIMIT 500;

MySQL Error : Unknown column 'posts.pagetext' in 'where clause'
Error Number : 1054
Request Date : Monday, August 25th 2008 @ 08:02:19 AM
Error Date : Monday, August 25th 2008 @ 08:02:19 AM
Script : http://www.vincentownersclub.co.uk/links/search.php
Referrer : http://www.vincentownersclub.co.uk/links/search.php
IP Address : 89.243.157.85
Username : Unregistered
Classname : vB_Database
MySQL Version :

Brian
08-25-2008, 02:55 PM
Thank you for pointing this out. Looks like there was an issue with the post table not being joined if you do not have vB's fulltext search options enabled. 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 update that one on your server, that should take care of the issue.
Or if you would rather apply the fix manually, just look in the file for this code:
case 'pagetext':
$fieldname = 'posts.pagetext';
break;


And replace with this:
case 'pagetext':
$fieldname = 'posts.pagetext';
$searchjoin .= ' LEFT JOIN ' . TABLE_PREFIX . 'adv_links_posts AS posts ON (posts.linkid = links.linkid)';
break;

Our Sponsors
 

grahamsmythe
08-25-2008, 03:26 PM
Hi Brian

I replaced the code, and will let you know if I get a repeat of the message.

Best regards.

Graham