My php script for registry is not working, its returning
Warning: mysql_query() [function.mysql-query]: Access denied for user '**'@'localhost' (using password: NO) in /home/**/public_html/register.php on line 10
and
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/**/public_html/register.php on line 10
Register.php
<?php
require('connect.php');
// If the values are posted, insert them into the database.
if (isset($_POST['username']) && isset($_POST['password'])){
$username = $_POST['username'];
$email = $_POST['email'];
$password = $_POST['password'];
$query = "INSERT INTO user (username, password, email) VALUES ('$username', '$password', '$email')";
$result = mysql_query(!$query);
if(!$result){
$msg = "User Created Successfully.";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>InfamousBurns - Register</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<!-- Form for logging in the users -->
<div>
<?php
if(isset($msg) & !empty($msg)){
echo $msg;
}
?>
<h1 id="post">Register</h1>
<form action="" method="POST">
<p id="post"><label>User Name : </label>
<input id="username" type="text" name="username" placeholder="username" />
</p>
<p id="post"><label>E-Mail : </label>
<input id="password" type="email" name="email" required placeholder="vivek@email.com" /> </p>
<p id="post"><label>Password : </label>
<input id="password" type="password" name="password" placeholder="password" /></p>
<a id="button" href="login.php">Login</a>
<input id="post" type="submit" name="submit" value="Register" />
</form>
</div>
</body>
</html>