Ok, trying to create a table in a mysql database via  php script.

heres the code:-

<?
$user="username";
$password="password";
$database="database";
mysql_connect(localhost,$user,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="CREATE TABLE contacts (id int(6) NOT NULL auto_increment,first
varchar(15) NOT NULL,last varchar(15) NOT NULL,phone varchar(20) NOT
NULL,mobile varchar(20) NOT NULL,fax varchar(20) NOT NULL,email varchar(30)
NOT NULL,web varchar(30) NOT NULL,PRIMARY KEY (id),UNIQUE id (id),KEY id_2
(id))";
mysql_query($query);
mysql_close();
?>

I have added the username, apssword and database in the top 3 lines, saged
the script into a file called create_table.php and gave it permissions of
777 to be safe.

What have I missed as its not creating the table.

Scott




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to