How can I check if a table exists in a mysql db. If it table does not exist, then,

$news = mysql_query($sql_create);

else

$news = mysql_query($sql);

Not sure I know where to start?


-----snip--------
$server = "localhost";
$user = "user1";
$pass = "****";
$db="user1table";
$table="comments";

$myconnection = mysql_connect($server,$user,$pass);
mysql_select_db($db,$myconnection);

$sql = 'SELECT * FROM '.$table.' WHERE MATCH (username) AGAINST 
(\''.stripslashes($searchenquiry).'\' IN BOOLEAN MODE) ORDER BY id asc;';

$sql_create = "CREATE TABLE ".$table." (
   id int(11) NOT NULL auto_increment,
   username varchar(100) NOT NULL,
   comment text,
   PRIMARY KEY (id)
);




Sorry, I'm not even sure if this is a php thing as much as it is also mysql.

-
John

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

Reply via email to