On 30-Mar-2003 Antti wrote:
> How do I test if a mysql table exists or not? Is there a function for
> this? I didn't find a good one.
>
> -antti
function tableexists($tbl) {
$res = @mysql_query("SELECT 1 FROM $tbl LIMIT 1");
return ($res ? true : false);
}
Regards,
--
Don Read
PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 31, 2003 1:34 AM
Subject: [PHP] Test tables existance
> How do I test if a mysql table exists or not? Is there a function for
> this? I didn't find a good one.
>
> -antti
>
>
> --
> PHP General Mai
Come on, check the mysql section of the PHP manual ... this took about 20 sec
http://www.php.net/manual/en/function.mysql-list-tables.php
At 11:34 PM 3/30/2003 +0300, Antti wrote:
How do I test if a mysql table exists or not? Is there a function for
this? I didn't find a good one.
-antti
--
PHP
How do I test if a mysql table exists or not? Is there a function for
this? I didn't find a good one.
-antti
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
4 matches
Mail list logo