PDA

View Full Version : DataBase Error When Searching


Spika
12-29-2008, 12:23 PM
I have installed VBA LD without problems and the users can view and add new links, but Today I get two erros:

Database error in vBulletin 3.7.4:

Invalid SQL:

SELECT links.linkid
FROM vb_adv_links AS links
LEFT JOIN vb_adv_links_posts AS posts ON (posts.linkid = links.linkid)

WHERE (links.userid IN(93)) ANDlinks.valid IN(0, 1, 2)
ORDER BY links.name ASC 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 'ANDlinks.valid IN(0, 1, 2)
ORDER BY links.name ASC LIMIT 500' at line 5 Error Number : 1064 Request Date : Monday, December 29th 2008 @ 12:12:19 PM
Error Date : Monday, December 29th 2008 @ 12:12:19 PM
Script : http://www.gstrail.es/foro/links/search.php
Referrer : http://www.gstrail.es/foro/links/search.php
IP Address : 77.208.27.196
Username : lawan
Classname : vB_Database
MySQL Version : 5.0.45


Database error in vBulletin 3.7.4:

Invalid SQL:

SELECT links.linkid
FROM vb_adv_links AS links
LEFT JOIN vb_adv_links_posts AS posts ON (posts.linkid = links.linkid)

WHERE (links.userid IN(93)) ANDlinks.valid IN(0, 1, 2) links.catid IN(1,1,2,3,16,15) AND
ORDER BY links.name ASC 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 'ANDlinks.valid IN(0, 1, 2) links.catid IN(1,1,2,3,16,15) AND
ORDER BY links.n' at line 5
Error Number : 1064
Request Date : Monday, December 29th 2008 @ 12:12:09 PM
Error Date : Monday, December 29th 2008 @ 12:12:09 PM
Script : http://www.gstrail.es/foro/links/search.php
Referrer : http://www.gstrail.es/foro/links/search.php
IP Address : 77.208.27.196
Username : lawan
Classname : vB_Database
MySQL Version : 5.0.45


Thanks

Brian
12-29-2008, 01:13 PM
Thank you for pointing this out. I've just updated the links/search.php file in the download package here to include the fix, 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 line:
$condition .= 'links.' . ($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'] ? 'valid IN(0, 1, 2)' : 'valid = 1');


And replace with this:
$condition .= ' links.' . ($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'] ? 'valid IN(0, 1, 2)' : 'valid = 1');

(just adding a space between ' and links)

Our Sponsors
 

Spika
12-29-2008, 01:55 PM
Thank you very much!

Spika
01-04-2009, 06:58 PM
The fix donīt avoid the error,
Today I have recived two more:
Database error in vBulletin 3.7.4:

Invalid SQL:

SELECT links.linkid
FROM vb_adv_links AS links


WHERE (links.name LIKE '%gs %' OR keywords LIKE '%gs %' OR description LIKE '%gs %' AND links.name LIKE '%team %' OR keywords LIKE '%team %' OR description LIKE '%team %') AND links.valid = 1 links.catid IN(1,1,2,3,16,15) AND
ORDER BY links.name ASC 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 'links.catid IN(1,1,2,3,16,15) AND
ORDER BY links.name ASC LIMIT 500' at line 5 Error Number : 1064 Request Date : Sunday, January 4th 2009 @ 06:04:31 PM
Error Date : Sunday, January 4th 2009 @ 06:04:31 PM
Script : http://www.gstrail.es/foro/links/search.php
Referrer : http://www.gstrail.es/foro/links/search.php
IP Address : 85.56.155.25
Username : Titan
Classname : vB_Database
MySQL Version :