I keep getting this error when trying to write to the sql dbase:
Error 1065 : Query was empty
Primary key is auto_incremented. I included it as a NULL value but got the error, so I removed it, and yes, still got the error.
include '../include/db.php';
include '../include/error.php';
if (empty($forename) || empty($surname))
{
?>
Insert director...
<br>
<form method = "GET" action="index.php">
<br>
Surname: <input type = "text" name="surname" size=50>
<br>
Forename: <input type = "text" name="forename" size=50>
<br>
<input type = "submit">
</form>
}
else
{
if (!($connection = @ mysql_connect($hostname, $username, $password)))
die("Could not connect to the database");
if (!mysql_select_db($databasename, $connection))
showerror();
$insertquery = "INSERT INTO director VALUES
($surname, " .
"$forename)";
if ((@ mysql_query ($insertQuery,
$connection))
&& @ mysql_affected_rows() == 1)
echo "<h3Succesfully insertedh3>";
else
showerror();
} // if else empty()