0

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

3
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by Awah Mohamed
1

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.

Edited by Ezzaral: Snipped &quot;fake sig&quot; link. Please restrict such links to your site-wide user signature, which can be edited from the user control panel.

0

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

0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.