Ed,

> What query would I use to check for an existence of a table within a
> database? I'm currently writting a set of scripts in php. Is this possible
> with MySQL or do I need to create a condition within PHP?

In MySQL, you can issue:

 SHOW TABLES [FROM your_database] LIKE 'your_pattern'

Where 'your_pattern' might be a table name, or a pattern like 'tbl%'.

This statement will return the table name(s), or "empty set" if there
is no match.

With PHP, you could send a query to the MySQL server, like that:

 mysql_query("SHOW TABLES LIKE 'your_pattern'");

And find out what it returns.
 
Regards,
--
  Stefan Hinz <[EMAIL PROTECTED]>
  iConnect GmbH <http://iConnect.de>
  Heesestr. 6, 12169 Berlin (Germany)
  Telefon: +49 30 7970948-0  Fax: +49 30 7970948-3

[filter fodder: sql, mysql, query]


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to