Re: [PHP] if table not exists

2005-03-15 Thread Ligaya Turmelle
have you looked at the MySQL manual? http://dev.mysql.com/doc/mysql/en/create-table.html John Taylor-Johnston wrote: How do I get PHP to create a table, if one does not already exist? I have to do something with: $news = mysql_query($sql) or die(print mysql_error()); What can I also add something t

Re: [PHP] if table not exists

2005-03-15 Thread John Taylor-Johnston
> http://dev.mysql.com/doc/mysql/en/create-table.html Thanks. Then this looks reasonable? Would anyone code it differently? # $server = "localhost"; $user = "myname"; $pass = "mypass"; $db = "mydb"; $table = "demo_assignment1"; ###

Re: [PHP] if table not exists

2005-03-15 Thread Steve Buehler
http://dev.mysql.com/doc/mysql/en/create-table.html At 03:29 PM 3/15/2005, John Taylor-Johnston wrote: How do I get PHP to create a table, if one does not already exist? I have to do something with: $news = mysql_query($sql) or die(print mysql_error()); What can I also add something to $sql? $sql =

[PHP] if table not exists

2005-03-15 Thread John Taylor-Johnston
How do I get PHP to create a table, if one does not already exist? I have to do something with: $news = mysql_query($sql) or die(print mysql_error()); What can I also add something to $sql? $sql = "if not exists CREATE TABLE `demo_assignment1` ... John snip $server = "local