[dev] checking table existence

Chuck Hagenbuch chuck at horde.org
Tue Feb 3 08:27:07 PST 2004


Quoting Vilius Sumskas <vilius at lnk.lt>:

> what is the best way to check for table existence? Should I use pear's
> DB::getListOf('tables') or just SQL query "CREATE IF EXISTS TABLE..."?

CREATE IF EXISTS is mysql specific, I believe. Probably the best thing to do
would be to operate as normal, then check if any errors you get back are
DB_ERROR_NOSUCHTABLE.

-chuck

--
Charles Hagenbuch, <chuck at horde.org>
"Here, I brought some cole slaw. It's made from peeeooople! Just kidding."


More information about the dev mailing list