carp
Sat 5th Aug '00, 11:36am
I can't creat databases or tables! heres the code I am using to create a database called test_database and a table called email_info:
<?php
$connection = mysql_connect ("localhost", "myusername", "mypassword");
if ($connection == false){
echo mysql_errno().": ".mysql_error()."
";
exit;
}
$result = mysql_create_db ("test_database");
if ($result == false)
echo mysql_errno() . ": " . mysql_error() . "
";
$query = "create table email_info " .
"(fullname varchar(255), email_address varchar(255))";
$result = mysql_db_query ("test_database", $query);
if ($result)
echo "Table 'email_info' was successfully created!";
else
echo mysql_errno().": ".mysql_error()."
";
mysql_close ();
?>
Then when I run it, it says this:
1044: Access denied for user: 'myusername@localhost' to database 'test_database'
1044: Access denied for user: 'myusername@localhost' to database 'test_database'
Am I doing this right?
<?php
$connection = mysql_connect ("localhost", "myusername", "mypassword");
if ($connection == false){
echo mysql_errno().": ".mysql_error()."
";
exit;
}
$result = mysql_create_db ("test_database");
if ($result == false)
echo mysql_errno() . ": " . mysql_error() . "
";
$query = "create table email_info " .
"(fullname varchar(255), email_address varchar(255))";
$result = mysql_db_query ("test_database", $query);
if ($result)
echo "Table 'email_info' was successfully created!";
else
echo mysql_errno().": ".mysql_error()."
";
mysql_close ();
?>
Then when I run it, it says this:
1044: Access denied for user: 'myusername@localhost' to database 'test_database'
1044: Access denied for user: 'myusername@localhost' to database 'test_database'
Am I doing this right?