I'm testing out if my PHP is working along with MySQL. I used this script for test
<?php
$user="root";
$password="";
$database="test";
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();
?>
The code works but theirs message like this appeared:
PHP Notice: Use of undefined constant localhost - assumed 'localhost' in C:\Inetpub\wwwroot\index.php on line 12
Was there something wrong with the script or my PHP's configuration?