I do not know why it won't connect I have no ideas. When I try to connect it also tells me it's successfully connected to the mysql its weird please help.
It's been annoying the crap out of me and I really need it to work soon because it is driving me nuts.
<?
if(!empty($_POST['username']) && !empty($_POST['password']))
{
$username = mysql_real_escape_string($_POST['username']);
$password = md5(mysql_real_escape_string($_POST['password']));
$email = mysql_real_escape_string($_POST['email']);
$checkusername = mysql_query("SELECT * FROM users WHERE Username = '".$username."'");
if(mysql_num_rows($checkusername) == 1)
{
echo "<h1>Error</h1>";
echo "<p>Sorry, that username is taken. Please go back and try again.</p>";
$checkemail = mysql_query("SELECT * FROM users WHERE email = '".$email."'");
if(mysql_num_rows($checkemail) == 1)
{
echo "<h1>Error</h1>";
echo "<p>Sorry, that email is taken. Please go back and try again.</p>";
}
}
else
{
$registerquery = mysql_query("INSERT INTO users (Username, Password, EmailAddress) VALUES('".$username."', '".$password."', '".$email."')");
if($registerquery)
{
echo "<h1>Success</h1>";
echo "<p>Your account was successfully created. Please <a href=\"login.php\">click here to login</a>.</p>";
}
else
{
echo "<h1>Error</h1>";
echo "<p>Sorry, your registration failed. Please go back and try again.</p>";
}
}
}
else
{
?>
<h1>Register</h1>
<p>Please enter your details below to register.</p>
<form method="post" action="register.php" name="registerform" id="registerform">
<fieldset>
<label for="username">Username:</label><input type="text" name="username" id="username" /><br />
<label for="password">Password:</label><input type="password" name="password" id="password" /><br />
<label for="email">Email Address:</label><input type="text" name="email" id="email" /><br />
<input type="submit" name="register" id="register" value="Register" />
</fieldset>
</form>
<?php
}
?>
Mysql Connected Successfully
Warning: mysql_real_escape_string(): Access denied for user 'UNKNOWN_USER'@'localhost' (using password: NO) in /home/parap00per/public_html/register.php on line 28
Warning: mysql_real_escape_string(): A link to the server could not be established in /home/parap00per/public_html/register.php on line 28
Warning: mysql_real_escape_string(): Access denied for user 'UNKNOWN_USER'@'localhost' (using password: NO) in /home/parap00per/public_html/register.php on line 29
Warning: mysql_real_escape_string(): A link to the server could not be established in /home/parap00per/public_html/register.php on line 29
Warning: mysql_real_escape_string(): Access denied for user 'UNKNOWN_USER'@'localhost' (using password: NO) in /home/parap00per/public_html/register.php on line 30
Warning: mysql_real_escape_string(): A link to the server could not be established in /home/parap00per/public_html/register.php on line 30
Warning: mysql_query(): Access denied for user 'UNKNOWN_USER'@'localhost' (using password: NO) in /home/parap00per/public_html/register.php on line 32
Warning: mysql_query(): A link to the server could not be established in /home/parap00per/public_html/register.php on line 32
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/parap00per/public_html/register.php on line 34
Warning: mysql_query(): Access denied for user 'UNKNOWN_USER'@'localhost' (using password: NO) in /home/parap00per/public_html/register.php on line 48
Warning: mysql_query(): A link to the server could not be established in /home/parap00per/public_html/register.php on line 48
Error
Sorry, your registration failed. Please go back and try again.