One of the simplest PHP connections to an Access database and an example of inserting data into a database
<?php
$connstr = "Driver=microsoft Access DRIVER (*.mdb);D bq=". Realpath ("Db1.mdb");
$connid =odbc_connect ($connstr, "", "", SQL_CUR_USE_ODBC);
$ct 01=$_post[ct01];
$ct 02=$_post[ct02];
$ct 03=$_post[ct03];
$ct 04=$_post[ct04];
$ct 05=$_post[ct05];
$ct 06=$_post[ct06];
$name =$_post[name];
$danwei =$_post[danwei];
$email =$_post[email];
$tele =$_post[tele];
$QQ =$_POST[QQ];
$yb =$_post[yb];
$content =$_post[content];
$sql = "INSERT into TB_TJ (ct01,ct02,ct03,ct04,ct05,ct06,name,danwei,email,qq,yb,content)
VALUES (' $ct ', ' $ct ', ' $ct ', ' $ct ', ' $ct ', ' $ct ', ' $name ', ' $danwei ', ' $email ', ' $qq ', ' $yb ', ' $content ');
if (Odbc_do ($connid, $sql))
{
echo "<script>alert" Congratulations! Submit successfully! '); location= ' index.php ';</script> ';
}
Else
{
echo "<script>alert" (' Sorry! Commit failed! '); location= ' index.php ';</script> ';
}
?>