Hi,
I'm having trouble updating an Access databasewith PHP. I can read from a table in the database no problem, but i can't insert data. Also i get no error messages, the html form executes, but when i open the table in access there is no data added. My code is attached below, any help is appreciated,
Joe
<html>
<body>
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL & ~E_NOTICE);
if(isset($_POST['submit']))
{ //handle the form
$conn=odbc_connect('dentalrecords','','');
if (!$conn)
{
exit("Connection Failed: " . $conn);
}
$sql="INSERT INTO 'Table1'('field1')
VALUES('{$_POST['field1']}')";
$result=odbc_exec($conn, $sql)or die (odbc_errormsg());
if($result){
echo "Query Executed";
}else{
echo "Query failed " .odbc_error();
}
odbc_close($conn);
}
//endof form handling
?>
<form action="EnterDetails1.php" method="POST">
<p>Enter Trace Number: <input type="text" id="field1" size="40" /></p>
<input type="submit" id="submit" value="Enter Data" />
</form>
</body>
</html>