PDA

View Full Version : Invalid SQL When Searching By Username


penturners
10-04-2008, 02:13 PM
Getting this occasionally:

Database error in vBulletin 3.7.3:

Invalid SQL:

SELECT links.linkid
FROM adv_links AS links


WHERE (links.userid IN(2965,3459) OR posts.userid IN(2965,3459)) AND links.dateline >=1215362987 AND valid = 1
ORDER BY links.name ASC LIMIT 500;

MySQL Error : Unknown table 'posts' in where clause
Error Number : 1109
Request Date : Saturday, October 4th 2008 @ 12:49:47 PM
Error Date : Saturday, October 4th 2008 @ 12:49:47 PM
Script : http://www.penturners.org/links/search.php
Referrer : http://www.penturners.org/links/search.php
IP Address : 71.111.79.242
Username : SuperDave
Classname : vb_database

Brian
10-06-2008, 12:40 PM
Thank you for pointing this out. I've just applied the fix for this to the links/search.php file in the download package here, so if you will download the files again and replace that file on your server with the updated version, that should put a stop to the SQL errors.

Our Sponsors
 

penturners
10-23-2008, 09:54 PM
The database error is gone, but I don't this the behavior of the script is correct.

When searching for exact user name, it returns all usernames containing that string. See images.

Brian
10-24-2008, 01:11 PM
Not sure how that code got removed, but thank you for pointing that out. I've just updated the links/search.php file in the download package to correct the username issue as well, so if you will download the files from here and update that file on your server one more time, that should take care of that issue as well.

Our Sponsors
 

penturners
10-24-2008, 06:16 PM
And a further problem...

Database error in vBulletin 3.7.3:

Invalid SQL:

SELECT links.linkid
FROM adv_links AS links
LEFT JOIN adv_links_posts AS posts ON (posts.linkid = links.linkid)

WHERE (links.userid IN(4168)) AND valid = 1
ORDER BY categories.title ASC LIMIT 500;

MySQL Error : Unknown table 'categories' in order clause
Error Number : 1109
Request Date : Friday, October 24th 2008 @ 03:48:16 PM
Error Date : Friday, October 24th 2008 @ 03:48:17 PM
Script : http://www.penturners.org/links/search.php
Referrer : http://www.penturners.org/links/search.php
IP Address : 66.125.190.130
Username : Vince_Hoffmann
Classname : vb_database
MySQL Version :