Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Databases/Tables checking if they exist

    How is it done. I was thinking, that trying to make a database/table and if it failed then it already existed but then i thought it might overwrite instead so i figured i would ask before i tried.

  • #2
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,633
    Thanks
    4
    Thanked 148 Times in 139 Posts
    If you try and make one that exists then it will not allow you to do so and will generate an error message.

    You can use
    Code:
    SHOW DATABASES
    or
    Code:
    SHOW TABLES
    to see all your databases or all your tables in the currently selected database.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •