|
Posted by Zoe Brown on 10/26/05 13:23
I am new to PHP and mysql.
I am trying to create a database with just one table. How do I setup the
username and password ?
I am trying to run a script like this
$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();
but am getting the error
"Warning: Access denied for user: 'username@127.0.0.1' (Using password: YES)
in c:\phpdev\www\work\budget\guava\database\create.php on line 7
Warning: MySQL Connection Failed: Access denied for user:
'username@127.0.0.1' (Using password: YES) in
c:\phpdev\www\work\budget\guava\database\create.php on line 7
Unable to select database"
Zoe
Navigation:
[Reply to this message]
|