Server Help

Trash Talk - Help time.

Gravitron - Sat Jul 30, 2005 5:31 pm
Post subject: Help time.
My turn to ask.

Quote:

SQL Error : 1109 Unknown table 'c' in where clause

SELECT * FROM phpbb_forums f WHERE f.cat_id = c.cat_id ORDER BY c.cat_order, f.forum_order ASC

Line : 767
File : admin_ug_auth.php


And unless I mistook the place:
Code: Show/Hide

   //
   // Front end
   //
   $sql = "SELECT *
      FROM " . FORUMS_TABLE . " f
      WHERE f.cat_id = c.cat_id
       ORDER BY c.cat_order, f.forum_order ASC";
   if ( !($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_ERROR, "Couldn't obtain forum information", "", __LINE__, __FILE__, $sql);
   }


After 48 hours of messing with this thing (not this error in specific, the entire forum and other errors) I'm way too tired to even look two seconds into what's causing this one.
Gravitron - Sat Jul 30, 2005 5:46 pm
Post subject:
Alright, so I'm missing a category table.
I think I know why, I messed with categories and forums earlier (like 24 hours ago, heh).
But which table indexes the missing table?
Where is it hiding, must find...then can remove...then no more errors! new_let_it_all_out.gif
Solo Ace - Sat Jul 30, 2005 5:46 pm
Post subject:
This really looks a little different from the last version I downloaded of phpBB2 and the package I just downloaded now.

Code: Show/Hide
   $sql = "SELECT f.*
      FROM " . FORUMS_TABLE . " f, " . CATEGORIES_TABLE . " c
      WHERE f.cat_id = c.cat_id
      ORDER BY c.cat_order, f.forum_order ASC";
   if ( !($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_ERROR, "Couldn't obtain forum information", "", __LINE__, __FILE__, $sql);
   }


It's even on another line.

I'd suggest re-downloading instead of trying to fix all these problems manually.
I doubt you need any explaination about the bugged SQL query after what I just posted, it's obvious the definition for 'c' is missing in your version. sa_tongue.gif
Solo Ace - Sat Jul 30, 2005 5:47 pm
Post subject:
Damn you, posting 2 seconds before I do huh. icon_sad.gif
Gravitron - Sat Jul 30, 2005 6:39 pm
Post subject:
http://www.phpbbfm.net
Pests - Sun Jul 31, 2005 9:40 pm
Post subject:
If you look at the original query:

SELECT * FROM phpbb_forums f WHERE f.cat_id = c.cat_id ORDER BY c.cat_order, f.forum_order ASC

You see phpbb_forums is being represented as f later in the query. The problem is, c is being used as a reference before it was defined. I'm assuming c stands for category, so you need to change the query to:


SELECT * FROM phpbb_forums f, phpbb_category c WHERE f.cat_id = c.cat_id ORDER BY c.cat_order, f.forum_order ASC

Assuming phpbb_category is the name of the category table (not sure if its plural or whatnot).
Cyan~Fire - Mon Aug 01, 2005 11:21 am
Post subject:
Uhhh, Pests, look at Solo Ace's post.
Pests - Tue Aug 02, 2005 4:55 pm
Post subject:
Damn, thats what I get for not reading replies. icon_smile.gif
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group