The following PHP Script does the job, i.e., adding a new record to the MS-Access Database.
Code: Select all
<?php
$db = 'myDB.mdb';
$conn = new COM('ADODB.Connection');
$conn->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=$db");
$sql = "insert into contactsTbl(fName,mName,lName,phoneNo)
values('Mr. Z','Kumar','Verma','Mobile# 99999999')";
$rs = $conn->Execute($sql);
$rs.Update;
$rs->Close();
$conn->Close();
$rs = null;
$conn = null;
?>I checked the Database and the New Record is there! So, what could be the problem in the PHP Script that is causing the Error: HTTP 500, as given above?The website cannot display the page
HTTP 500
Most likely causes:
•The website is under maintenance.
•The website has a programming error.
Note: All the fields are of Text Data Type and their sizes are set to 30 (characters) in the database.