Thanks surefire,
I am specifying the db like you posted. I am wondering if it's a password problem.
I am using
HOST: "localhost"
USER: "user_user" -except my actual user (the one that I set up in cpanel)
PASS: "mypass" -except my actual pass (the one that I set up in cpanel)
DB: "trial"
I usually get error:
1044: Access denied for user: 'user_user@localhost' to database 'trial'
There must be something that I am not doing right????
Thanks for the help so far Thumbs Up
I'll keep trying
Here is a copy of the script that I am currently playing with:
><?php
$connection = mysql_connect ("localhost", "user_user", "pass");
if ($connection == false){
echo mysql_errno().": ".mysql_error()."<BR>";
exit;
}
$query = "create table email_info " .
"(fullname varchar(255), email_address varchar(255))";
$result = mysql_db_query ("trial", $query);
if ($result)
echo "Table 'email_info' was successfully created!";
else
echo mysql_errno().": ".mysql_error()."<BR>";
mysql_close ();
?>
<?php
if ($submit == "click"){
// The submit button was clicked!
// Get the input for fullname and email then store it in the database.
$connection = mysql_connect ("", "", "");
if ($connection == false){
echo mysql_errno().": ".mysql_error()."<BR>";
exit;
}
$query = "insert into email_info values ('$fullname', '$email')";
$result = mysql_db_query ("trial", $query);
if ($result){
echo "Success!";
}
else{
echo mysql_errno().": ".mysql_error()."<BR>";
}
mysql_close ();
}
else{
echo "
<html><body>
<form method=\"post\" action=\"insert.php3\">
Enter your full name
<input type=\"text\" name=\"fullname\"></input><br>
Enter your email address
<input type=\"text\" name=\"email\"></input><br>
<input type=\"submit\" name=\"submit\" value=\"click\"></input>
</form>
</body></html>
";
}
?>
I get a similar error no matter what script I use...