Code:
<?php
$user = "username";
$password = "password";
$database = "dbname";

mysql_connect(localhost,$user,$password);
@mysql_selectdb($database)or die("Error!");

$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();

?>



although it did work the table was created i got this error

Notice: Use of undefined constant localhost - assumed 'localhost' in *path here* on line 6