Re: MySQL ?
| From: | Tom Rogers | Date: | Fri, 06 Dec 2002 06:50:59 +0000 |
| Subject: | Re: MySQL ? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-127227@lists.php.net to get a copy of this message | ||
Hi,
Friday, December 6, 2002, 2:08:42 AM, you wrote:
h> I am really sorry but i can't find any good mySQL good mailing list...
h> How can i make a little php function to check if a table exists ?
h> Thanks a lot,
h> Hacook
function table_exists($table){
return (@mysql_query('SELECT count(*) FROM '.$table));
}
//usage
$con = @mysql_connect("host" , "user" , "password");
$table = "database.table";
if(table_exists($table)){
echo "Table $table exists. <br>";
}else{
echo "Table $table does not exist.<br>";
}
--
regards,
Tom