#1
  1. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,672
    Rep Power
    171

    Table doesn't exist, but it shows in show tables!


    Hi;

    Why can't I select from behnam.shak_content table?

    This error is nonesense.

    Code:
    mysql> show tables;
    +---------------------+
    | Tables_in_behnam    |
    +---------------------+
    | behnam.shak_content |
    | members             |
    +---------------------+
    2 rows in set (0.00 sec)
    
    mysql> select * from behnam.shak_content;
    ERROR 1146 (42S02): Table 'behnam.shak_content' doesn't exist
  2. #2
  3. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,143
    Rep Power
    9398
    Somehow you managed to name a table with a period in it. That's bad.

    If you just say "behnam.shak_content" MySQL will think you mean the shak_content table in the behnam database.
    First use quotes,
    Code:
    SELECT * FROM `behnam.shak_content`;
    then rename the table.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,451
    Rep Power
    1751
    Originally Posted by requinix
    Somehow you managed to name a table with a period in it. That's bad.

    If you just say "behnam.shak_content" MySQL will think you mean the shak_content table in the behnam database.
    First use quotes,
    Code:
    SELECT * FROM `behnam.shak_content`;
    then rename the table.
    How much you want to bet that is how the create table was done (with `behnam.shak_content` instead of `behnam`.`shak_content`)? - even if the backticks are not needed.

    Comments on this post

    • requinix agrees : I would not bet against that
    The moon on the one hand, the dawn on the other:
    The moon is my sister, the dawn is my brother.
    The moon on my left and the dawn on my right.
    My brother, good morning: my sister, good night.
    -- Hilaire Belloc
  6. #4
  7. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,672
    Rep Power
    171
    Cant rename or drop it either
  8. #5
  9. Code Monkey V. 0.9
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2005
    Location
    A Land Down Under
    Posts
    2,122
    Rep Power
    1990
    Did you use the backticks in the name reference? Remember that you need those when there's something "wrong" with the table name.

    Code:
    DROP TABLE `behnam.shak_content`;
    I've just tested that and it works here. I can't imagine why it wouldn't work for you as well - unless you're getting some other error that's not related to the table name.
  10. #6
  11. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,672
    Rep Power
    171
    Originally Posted by Catacaustic
    Did you use the backticks in the name reference?
    Yes it's functioning well. I was not using `. I was using '.

    1 billion things to learn :Q

    Thank you

IMN logo majestic logo threadwatch logo seochat tools logo