Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Debug error!

DarkfspDarkfsp Member Posts: 1
Im getting a debug error, I've tracked it down and have been messing with the problem. I know I need to creat a table, but I've just recently got into SQL so I'm looking to see if I can find some one to help me out a little with the info I need to enter on the new table. Here's the error Im getting

General Error
Couldn't obtain forum information

DEBUG MODE

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

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

Line : 767
File : admin_ug_auth.php

Feel free to reach me on AIM or reply on here.
Thank you in advance!

Comments

  • tvientitvienti Member Posts: 230
    MySQL 101: The basics

    A basic SELECT statement is generally in the form:

    [code]SELECT [field list] FROM [table list] WHERE [conditions][/code]

    There are other options but for your problem, let's look at this basic structure. Whenever your field list or condition list draws from multiple tables, it's best to prefix each field name with a table name so there's no ambiguity. For example, maybe table `people` and table `places` both have an `id` column. You would differentiate as follows:

    [code]SELECT `people`.`id`, `places`.`id` FROM `people`, `places`;[/code]

    That works fine but if you have a lot of fields in the field list, or a lot of conditions, it becomes tedious to type out the table name over and over and over again. To alleviate this, you can assign abbreviated names for the table by listing the abbreviation after the table in the FROM table list. Example:

    [code]SELECT `ppl`.`id`, `plc`.`id` FROM `people` ppl, `plc` plc;[/code]


    If you look at the first part of your query:

    [code]SELECT * FROM phpbb_forumfmforums f WHERE f.cat_id = c.cat_id[/code]

    The * in the field list just means select all fields from all tables, that's fine. In the FROM table list you have just one forum, phpbb_forumfmforums, nicknamed 'f'. However in the WHERE conditions you refer to two tables, "f", which is in your table list, and "c" which is not. Your query needs another table in the table list, with a nickname of 'f', in order to run.

    That was probably more long-winded than was necessary but .... I'm bored.

    T

    : Im getting a debug error, I've tracked it down and have been messing with the problem. I know I need to creat a table, but I've just recently got into SQL so I'm looking to see if I can find some one to help me out a little with the info I need to enter on the new table. Here's the error Im getting
    :
    : General Error
    : Couldn't obtain forum information
    :
    : DEBUG MODE
    :
    : SQL Error : 1109 Unknown table 'c' in where clause
    :
    : SELECT * FROM phpbb_forumfmforums f WHERE f.cat_id = c.cat_id ORDER BY c.cat_order, f.forum_order ASC
    :
    : Line : 767
    : File : admin_ug_auth.php
    :
    : Feel free to reach me on AIM or reply on here.
    : Thank you in advance!
    :

Sign In or Register to comment.