Results 1 to 4 of 4

Thread: DataBase Error When Searching

  1. #1
    Join Date
    Jun 2006
    Posts
    9

    Default DataBase Error When Searching

    I have installed VBA LD without problems and the users can view and add new links, but Today I get two erros:

    Code:
    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
    Code:
    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

  2. #2
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default

    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:
    PHP Code:
        $condition .= 'links.' . ($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'] ? 'valid IN(0, 1, 2)' 'valid = 1'); 
    And replace with this:
    PHP Code:
        $condition .= ' links.' . ($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'] ? 'valid IN(0, 1, 2)' 'valid = 1'); 
    (just adding a space between ' and links)

  3. #3
    Join Date
    Jun 2006
    Posts
    9

    Default

    Thank you very much!

  4. #4
    Join Date
    Jun 2006
    Posts
    9

    Default

    The fix don´t avoid the error,
    Today I have recived two more:
    Code:
    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 :

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Database Error When Searching by Username
    By Spika in forum Bugs From 3.1.0
    Replies: 2
    Last Post: 01-06-2009, 03:00 PM
  2. Links Directory - Database Error When Searching
    By grahamsmythe in forum Bugs From 3.0 RC1
    Replies: 2
    Last Post: 08-25-2008, 03:26 PM
  3. Error of Keyword searching....V2.0.1
    By nostalgia in forum Bugs From 2.0.1
    Replies: 5
    Last Post: 03-05-2007, 04:58 PM
  4. Error message when searching keywords
    By Jester in forum Troubleshooting & Problems
    Replies: 1
    Last Post: 12-20-2004, 04:48 PM
  5. mysql error when searching advanced
    By teksigns in forum Bugs From 1.0 RC3
    Replies: 7
    Last Post: 11-07-2004, 12:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •