PDA

View Full Version : sql error: Column 'catid' in where clause is ambiguous


diettalk
10-18-2008, 11:11 AM
Database error in vBulletin 3.7.3:

Invalid SQL:

SELECT links.linkid
FROM adv_links AS links
LEFT JOIN adv_links_categories AS categories ON (links.catid = categories.catid)
WHERE links.valid = 1
AND catid = 2 AND links.userid = 11630
ORDER BY categories.title ASC;

MySQL Error : Column 'catid' in where clause is ambiguous
Error Number : 1052
Request Date : Wednesday, October 15th 2008 @ 04:58:12 AM
Error Date : Wednesday, October 15th 2008 @ 04:58:12 AM
Script : http://www.vvv.com/links/showlink.php?l=18&goto=previous&catid=2&orderby=category&direction=ASC&linkuserid=11630
Referrer :
IP Address : 38.98.xxx.xx
Username : Unregistered
Classname : vB_Database
MySQL Version :

Brian
10-18-2008, 12:06 PM
Thank you for pointing this out. I've went ahead and applied the fix to the forum/includes/vba_links_plugin_sf.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 line:
$linkquery = 'AND catid = ' . $catid;

And replace with this:
$linkquery = 'AND links.catid = ' . $catid;

Our Sponsors
 

diettalk
10-18-2008, 07:30 PM
$linkquery = 'AND links.catid = ' . $catid;

Brian
10-20-2008, 12:34 PM
Thanks... I think my copy/paste buttons are acting up.