So, I am writing some php scripts for my website, and the INSERTing of data is not working. What I am wanting for now, and for future reference is a way to output the error as no syntax errors are already being outputted.
How would I echo out the error in my code?
echo "POSTed Data - ".$username.", ".$password."<br>";
$UserData_SQLInsert = "INSERT INTO UserData ( Username, Password ) VALUES ( ".$username.", ".$password." ) ";
if (mysql_query(UserData_SQLInsert)) {
echo "INSERT INTO UserData - Succcessful.<br><br>";
}
else {
echo "INSERT INTO UserData - Failed.<br><br>";
mysql_query(UserData_SQLInsert) or die(mysql_error());
}