I keep getting this error:
Warning: mysqli_connect(): (42000/1044): Access denied for user 'p04294726'@'%.dmu.ac.uk' to database 'cottage' in H:\p3t\phpappfolder\public_php\project\addcustomer.php on line 10
(This the correct error)
Can anyone help me to fix it
Here is the full php code
define ("QUERY", "INSERT INTO customers (title, forename, surname, addressone, addresstwo, city, postcode, phone, email, username, password) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,)");
$title = $_POST['title'];
$forename = $_POST['name'];
$surname = $_POST['surname'];
$addressone = $_POST['firstadd'];
$addresstwo= $_POST['secondadd'];
$city = $_POST['city'];
$postcode = $_POST['postcode'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$username = $_POST['user'];
$password = $_POST['password'];
$statement = mysqli_prepare($connection, QUERY);
mysqli_stmt_bind_param($statement,
"sssssssisss",
$_POST['title'],
$_POST['name'],
$_POST['surname'],
$_POST['firstadd'],
$_POST['secondadd'],
$_POST['city'],
$_POST['postcode'],
$_POST['phone'],
$_POST['email'],
$_POST['user'],
$_POST['password']);
mysqli_stmt_execute($statement);
switch(mysqli_stmt_errno($statement))
{
case 0:
$addcottageComplete = true;
$addcottageOutcomeMessage = "Customer " . $_POST['name'] . " added";
break;
default:
$addcottageComplete = true;
$addcottageOutcomeMessage = mysqli_stmt_error($statement);
}
echo $addcottageOutcomeMessage;
include ("index.html");
mysqli_stmt_close($statement);
mysqli_close($connection);