hello guys , this is my code which i am trying to use to sign up to test my database connection, so usually when i try to sign up it tells me there is something wrong on line 11 any way this is the code

<?
$mysql_host = "mysql9.000webhost.com";
$mysql_database = "a2354076_post";
$mysql_user = "username";
$mysql_password = "*****";
$tbl_name = "admins";
$myusername =$_POST['username'];
$mypassword = $_POST['password'];
$name=$_POST['name'];
$email=$_POST['email'];
mysql_connect("$mysql_host","$mysql_user","$mysql_password")or die ("cannot connect to DB");
mysql_select_db ("$mysql_database")or die('can not connet to database , please try again later');
$sql="INSERT INTO $tbl_name (name, username, passwrod, email) values ('$name','$myusername','$mypassword','$email')"; 
$result= mysql_query($sql);
if($result)
{
echo "successful operation, you can access to your admin at any time | by Awah mohamad";
}
else
{
echo "please try again because a error has happened ";
}
include('db/mysql_close.php');
?>

and this is the out put


Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'a2354076_admin'@'10.0.0.24' (using password: YES) in /home/public_html/admin/sign_up/sign_up_prog.php on line 11

Free Web Hosting
cannot connect to DB

Recommended Answers

All 4 Replies

hello guys , this is my code which i am trying to use to sign up to test my database connection, so usually when i try to sign up it tells me there is something wrong on line 11 any way this is the code

<?
$mysql_host = "mysql9.000webhost.com";
$mysql_database = "a2354076_post";
$mysql_user = "username";
$mysql_password = "*****";
$tbl_name = "admins";
$myusername =$_POST['username'];
$mypassword = $_POST['password'];
$name=$_POST['name'];
$email=$_POST['email'];
mysql_connect("$mysql_host","$mysql_user","$mysql_password")or die ("cannot connect to DB");
mysql_select_db ("$mysql_database")or die('can not connet to database , please try again later');
$sql="INSERT INTO $tbl_name (name, username, passwrod, email) values ('$name','$myusername','$mypassword','$email')"; 
$result= mysql_query($sql);
if($result)
{
echo "successful operation, you can access to your admin at any time | by Awah mohamad";
}
else
{
echo "please try again because a error has happened ";
}
include('db/mysql_close.php');
?>

and this is the out put


Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'a2354076_admin'@'10.0.0.24' (using password: YES) in /home/public_html/admin/sign_up/sign_up_prog.php on line 11

Free Web Hosting
cannot connect to DB

according to your original post (not displayed here) you to tried to access the db as
'a2354076_admin'. the problem is that wither the user name does not exist or you supplied a wrong password.

yea you are right my password was wrong ,thank you,but the problem now is i can not add any new detalis , i mean it is usually sory,please try again later (the die message)so what can i do else to

your problem is same happen with me, that's mean your mysql username not approved yet by 000webhost admin. so you must tell or email them.

thanks to all of you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.