RE: [PHP] checking for tables
| From: | Don Read | Date: | Mon, 11 Dec 2000 03:54:40 +0000 |
| Subject: | RE: [PHP] checking for tables | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-29629@lists.php.net to get a copy of this message | ||
On 10-Dec-00 Joe Stump wrote:
> Anyone know how to check if a MySQL table exists easily?
>
function tableexists($tbl) {
$res = @mysql_db_query(DB, "select count(*) from $tbl");
return ($res ? true : false);
}
Regards,
--
Don Read dread@texas.net
-- The problem with people who have no vices is that you can be
sure they're going to have some pretty annoying virtues.