faqts : Computers : Programming : Languages : PHP : Database Backed Sites : General

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

3 of 5 people (60%) answered Yes
Recently 3 of 5 people (60%) answered Yes

Entry

Is there an easy way to check if a table already exisits in a database using PHP?

Dec 20th, 2001 08:54
MyNameIs Monkey, Ony Cejas, Ben Udall, http://www.php.net/manual/en/function.mysql-list-tables.php


<?
mysql_select_db($yourdb); 
$tables=mysql_list_tables($yourdb); 
while (list($tablename)=mysql_fetch_array($tables)) 
{
echo $tablename." are the tablenames";
echo "<br>";
}