Re: [PHP] Checking if database has been setup

2004-02-07 Thread Don Read

On 07-Feb-2004 Ryan A wrote:



> but how do i check if the database/tables have
> been setup?
> 

SHOW DATABASES LIKE 'mydb';
SHOW TABLES FROM mydb LIKE 'mytable';

Check if a table exists:

SELECT 1 FROM mydb.mytable LIMIT 1;

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Checking if database has been setup

2004-02-06 Thread Joshua D. Drake
> if its setup or not. I can handle the setup in steps (the "setup wizard")
> but how do i check if the database/tables have
> been setup?
> 

It may be helpful to know which database as each database has there own 
way...

> (and my apoligies for using "setup" so many times :-p )
> 
> Any advise, urls or bits of code would be appreciated.
> 
> Thanks,
> -Ryan
> 
> 

-- 
Co-Founder
Command Prompt, Inc.
The wheel's spinning but the hamster's dead

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Checking if database has been setup

2004-02-06 Thread Ryan A
Hey,
Sometime back i was checking out a script and it had a very useful little
bit, in the scripts control panel there was
a text link that said "click here to see if your database has been setup"
when you click it, it will tell you if its setup
or lauches the setup script to help you set it up.

I think thats a pretty cool feature for someone who knows nothing about
setting up a database and does not know
if its setup or not. I can handle the setup in steps (the "setup wizard")
but how do i check if the database/tables have
been setup?

(and my apoligies for using "setup" so many times :-p )

Any advise, urls or bits of code would be appreciated.

Thanks,
-Ryan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php