View Single Post
  #2 (permalink)  
Old Mar 1st, 2008, 08:31
Jack Franklin's Avatar
Jack Franklin Jack Franklin is offline
Resources Administrator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,268
Blog Entries: 7
Thanks: 10
Thanked 4 Times in 4 Posts
Re: creating tables only once

If you upload a file which says 'CREATE TABLE example...'
And then navigate to it, as long as your code is right, it will create the table.

But you would use php to do that.
PHP: Select all

$sql mysql_query("CREATE TABLE example...");
if (
$sql) {
echo 
'Done'
} else {
echo 
'Error';

Remembering that you would need to be connected to the database first

If you were then to navigate to that file again, it would give an error because the table already exists. MySQL will not overwrite if the table already exists.

Jack
Reply With Quote