Can anyone see what may be wrong with the code. The resulting page tells me it has not worked . Displays what is in the database but not the record I have just added'
Code:
Code: Select all
<?php
$linkID = @mysql_connect("localhost", "root", "");
mysql_select_db("Customer", $linkID);
$result = mysql_query("INSERT INTO tblcustomer( CustName, CustAdd1, CustAdd2, CustAdd3, CustCity, CustCounty, CustPostCode, CustPhone, CustEmail, ShoeSize, CustGender) VALUES( '$CustName', '$CustAdd1', '$CustAdd2', '$CustAdd3', '$CustCity', '$CustCounty', '$CustPostCode', '$CustPhone', '$CustEmail', '$ShoeSize', '$CustGender')", $linkID);
if ($result == true)
{
print "The New Record Has Been Added<p>";
}
else
{
print "Something wrong here<p>";
}
$resultID = mysql_query("SELECT * FROM tblCustomer", $linkID);
Print "<table border=1 ><tr><th>ID</th>";
print "<th>Name</th><th>Addr1</TH><th>Addr2</th><th>Addr3</th><th>City</th><th>County</th><th>PostCode</th><th>Phone</th><th>Email</th><th>Date Entered</th><th>Shoe Size</th><th>Gender</th>";
while($row = mysql_fetch_row($resultID))
{
print"<tr>";
foreach($row as $field)
{
print"<td>$field</td>";
}
Print "</tr>";
}
print "</table>";
mysql_close($linkID);
?>