I have been trying to update the details in a access database but, all I get is a white screen and all the errors I have built-in give me no help at all.
All help is greatly appreciated.
[PHP]<html>
<head><title> Customer Information Updated</title></head>
<body>
<?php
$connstr = "DRIVER={Micros oft Access Driver (*.mdb)}; DBQ=" . realpath("2Poin tB.mdb").";";
$conn=odbc_conn ect($connstr,'' ,'') or die(Print "connect error: ".odbc_error()) ;
if($_POST[Emergency_Conta ct_Name]=="")$Emergency _Contact_Name=' NULL';
else $Emergency_Cont act_Name=$_POST[Emergency_Conta ct_Name];
if($_POST[Emergency_Conta ct#]=="")$Emergency _Contact#='NULL ';
else $Emergency_Cont act#=$_POST[Emergency_Conta ct#];
if($_POST[Telephone]=="")$Telephone ='NULL';
else $Telephone=$_PO ST[Telephone];
if($_POST[Special_Deitary _Requirements]=="")$Special_D eitary_Requirem ents='NULL';
else $Special_Deitar y_Requirements= $_POST[Special_Deitary _Requirements];
$sql="update tblCustomer set Customer_ID='$_ POST[Customer_ID]',Surname='$_PO ST[Surname]',Forename='$_P OST[Forename]', DOB='$_POST[DOB]',Sex='$_POST[Sex]',Address='$_PO ST[Address]', Town ='$_POST[Town]', City='$_POST[City]', Post_Code ='$_POST[Post_Code]', Telephone='$_PO ST[Town]', Emergency_Conta ct_Name='$_POST[Emergency_Conta ct_Name]', Emergency_Conta ct#='$_POST[Emergency_Conta ct#]', Special_Deitary _Requirements=' $_POST[Special_Deitary _Requirements]' where Customer_ID='$_ POST[Customer_ID]'";
$stmt=odbc_exec ($conn, $sql)
or die (Print "execute error: ".odbc_error()) ;
odbc_exec($conn , $stmt) or die (Print "error".odbc_er ror());
print "Thanks ".$Forename "your customer information has been updated";
?>
</body>
</html>
[/PHP]
All help is greatly appreciated.
[PHP]<html>
<head><title> Customer Information Updated</title></head>
<body>
<?php
$connstr = "DRIVER={Micros oft Access Driver (*.mdb)}; DBQ=" . realpath("2Poin tB.mdb").";";
$conn=odbc_conn ect($connstr,'' ,'') or die(Print "connect error: ".odbc_error()) ;
if($_POST[Emergency_Conta ct_Name]=="")$Emergency _Contact_Name=' NULL';
else $Emergency_Cont act_Name=$_POST[Emergency_Conta ct_Name];
if($_POST[Emergency_Conta ct#]=="")$Emergency _Contact#='NULL ';
else $Emergency_Cont act#=$_POST[Emergency_Conta ct#];
if($_POST[Telephone]=="")$Telephone ='NULL';
else $Telephone=$_PO ST[Telephone];
if($_POST[Special_Deitary _Requirements]=="")$Special_D eitary_Requirem ents='NULL';
else $Special_Deitar y_Requirements= $_POST[Special_Deitary _Requirements];
$sql="update tblCustomer set Customer_ID='$_ POST[Customer_ID]',Surname='$_PO ST[Surname]',Forename='$_P OST[Forename]', DOB='$_POST[DOB]',Sex='$_POST[Sex]',Address='$_PO ST[Address]', Town ='$_POST[Town]', City='$_POST[City]', Post_Code ='$_POST[Post_Code]', Telephone='$_PO ST[Town]', Emergency_Conta ct_Name='$_POST[Emergency_Conta ct_Name]', Emergency_Conta ct#='$_POST[Emergency_Conta ct#]', Special_Deitary _Requirements=' $_POST[Special_Deitary _Requirements]' where Customer_ID='$_ POST[Customer_ID]'";
$stmt=odbc_exec ($conn, $sql)
or die (Print "execute error: ".odbc_error()) ;
odbc_exec($conn , $stmt) or die (Print "error".odbc_er ror());
print "Thanks ".$Forename "your customer information has been updated";
?>
</body>
</html>
[/PHP]
Comment