PDA

View Full Version : Search by user name database error.


attroll
07-08-2008, 02:26 AM
If I go to search and do a search just by user name I get a database error every time.

Invalid SQL:

SELECT links.linkid
FROM adv_links AS links


WHERE ) AND (links.userid IN(8)) AND valid = 1
LIMIT 10000;

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 (links.userid IN(8)) AND valid = 1
LIMIT 10000' at line 5
Error Number : 1064
Request Date : Tuesday, July 8th 2008 @ 12:25:32 AM
Error Date : Tuesday, July 8th 2008 @ 12:25:32 AM
Script : http://www.****.net/forum/links/search.php
Referrer : http://www.****.net/forum/links/search.php
IP Address : 74.75.195.47
Username : attroll
Classname : vB_Database
MySQL Version : 4.1.22-standard

Brian
07-08-2008, 04:35 PM
Thank you for pointing this out. I've just applied the fix to the links/search.php file here, so if you will download the files again and replace that file on your server with the updated version, that should take care of the problem.
Or if you would rather apply the fix manually, just look in the file for this line:
$condition .= ') AND ';

And replace with this:
if ($condition)
{
$condition .= ') AND ';
}

Our Sponsors
 

attroll
07-09-2008, 01:02 AM
Brian

I search my /links/search.php file for the following line and there is no line like that.

$condition .= ') AND ';

Brian
07-10-2008, 07:24 PM
The files can still be downloaded from here if yours does not contain that code.