Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2004
    Posts
    494

    Unanswered: detect if db table exists by php

    I know how to create a table:
    PHP MySQL Create Database and Tables
    But how can I detect if the table exists. And if it doesn't, then create one using php?
    Compare bible texts (and other tools):
    TheWheelofGod

  2. #2
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    450 posts and you haven't discovered the MySQL online manual yet?

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    feel the force, luke

    use the "IF NOT EXISTS" option of the mysql CREATE TABLE statement

    da manual is your friend
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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