I have done the changes and still have errors. It is coming up with Error adding submitted details: Query was empty and ot showing anything else. what is wrong.
Below is my code:
<html>
<head>
<title> Customer Details </title>
</head>
<body>
<?php
if (isset($_POST['addcustomer']))
{
?>
<form action=<?=$_SERVER['PHP_SELF']?> "method="post">
<p>Please enter your details <br>
FirstName: <input type="text" name="FirstName" /> <br>
LastName: <input type="text" name="LastName" /> <br>
<input type="hidden" name="submitcustomer" value="true" />
<input type="submit" value="SUBMIT">
</p>
</form>
<?php
}
else
$dbcnx = @mysql_connect('localhost', 'root', '');
if (!$dbcnx)
{
die( '<p>Sorry Fernbarrrow website is experiencing difficuties at current.</p>');
}
if (! @mysql_select_db('customerdetails' ) )
{
die ( '<p>Sorry Fernbarrrow website is experiencing difficuties at current.</p>');
}
if (isset($_POST['submitcustomer']))
{
$FirstName = $_POST['FirstName'];
$sql = "INSERT INTO customerdetails VALUES
CustomerID='$customerid";
}
if (@mysql_query($sql))
{
echo('<p>Your details have been added.</p>');
} else {
echo('<p>Error adding submitted details: ' .
mysql_error() . '</p>');
}
?>
</body>
</html>