I'm getting this error though?
Code
Failed to connect to MySQL: Access denied for user 'dawsonde_test'@'localhost' (using password: YES)Error:
using this
Code
<?php
//Create a mysql connection
$con=mysqli_connect("localhost","dawsonde_admin","pass1","dawsonde_survey");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
//query returns a boolean, true if successfull, false if it fails.
if(!mysqli_query($con,"INSERT INTO Answers (fullname, phone)
VALUES ('$_POST[name]','$_POST[answer]')")){
die('Error: ' . mysqli_error($con));
}
$sql="INSERT INTO Persons (fullname, phone)
VALUES
('$_POST[fullname]','$_POST[phone]')";
if (!mysqli_query($con,$sql))
{
die('Error: ' . mysqli_error($con));
}
echo "1 record added";
mysqli_close($con);
?>
E: this is a web sql i'm trying to loginto
This post was edited by Daawsy on Sep 20 2013 02:52am