Mark,
Why not interrogate the system catalogue ? Then if the table does not
exist zero rows will be returned.
If the database you are using does not allow you to access the catalogue
with standard SQL then it should not call itself a relational database.
(See E.F. Codd's Rules for Relational Databases)
--Mark Thornber
Mark Riehl wrote:
>
> All,
>
> What's the easiest way to check and see if a table already exists in a
> database? I'm running MySQL on a Win2k box.
>
> The New Riders MySQL book has the following statements:
> SELECT COUNT(*) FROM table_name
> SELECT * FROM table_name WHERE 1=0
>
> Each statement will succeed if the table exists.
>
> Any other way (other than calling $dbh->tables() and looping through the
> results?
>
> Thanks,
> Mark
>
> --
> Mark Riehl
> Agile Communications, Inc.
> Email: [EMAIL PROTECTED]