PDA

View Full Version : database error


joggele
10-22-2006, 06:58 PM
Hello,

I want to manage categories. If I put the "Go" button (at the right side from the combobox), I get the follow database error:

"Datenbankfehler in vBulletin 3.6.2:

Invalid SQL:

SELECT moderator.userid, user.username, moderator.catid, categories.title
FROM vb_adv_links_moderator AS moderator
INNER JOIN vb_adv_links_categories AS categories ON (moderator.catid = categories.catid)
INNER JOIN vb_user ON (moderator.userid = user.userid)
WHERE moderator.userid = 1 AND moderator.catid = 2;

MySQL-Fehler : Unknown table 'user' in field list
Fehler-Nr. : 1109
Datum : Sunday, October 22nd 2006 @ 11:52:38 PM"


What's the problem of this? Can you help me?

kind regards
Jürgen

joggele
10-23-2006, 07:13 AM
Hello,

I have found the problem of database error.

In the file "vba_link_admin.php" is a wrong SQL statement. In line 1255 you can see:

INNER JOIN " . TABLE_PREFIX . "user ON (moderator.userid = user.userid)

Right is:

INNER JOIN " . TABLE_PREFIX . "user AS user ON (moderator.userid = user.userid)


The whole right statement is (from line 1251):

$moderator = $db->query_first("
SELECT moderator.userid, user.username, moderator.catid, categories.title
FROM " . TABLE_PREFIX . "adv_links_moderator AS moderator
INNER JOIN " . TABLE_PREFIX . "adv_links_categories AS categories ON (moderator.catid = categories.catid)
INNER JOIN " . TABLE_PREFIX . "user AS user ON (moderator.userid = user.userid)
WHERE moderator.userid = $modid AND moderator.catid = $catid
");


kind regards
Jürgen