0

Access テーブル ('test') にデータを挿入できません。PHP を使用して挿入する必要がある HTML フォームがあります。すべてうまくいっているように見えます (エラーはありません) が、Access テーブル ('test') を見ると、何も挿入されておらず、その理由がわかりません。SELECT は正常に動作しますが、何らかの理由で INSERT ができません。

助けてくれてありがとう。

test.html:

<html>
<body>

Enter Customer Information
<br>
(* indicates required fields)

<p>
<form action="test.php" method="post">
Last Name*: <input type="text" name="last">
<br>
First Name*: <input type="text" name="first">
</td>
</tr>
<input type="submit">
</form>
</body>
</html>

test.php:

<?php
$conn=odbc_connect('testdb','','');
$sql="INSERT INTO test (last, first)
VALUES
('$_POST[last]','$_POST[first]')" or die (sql_error);
odbc_exec($conn, $sql) or die (exec_error);
odbc_commit($conn) or die (comm_error);
odbc_close($conn);
echo "1 record added";
?> 
4

1 に答える 1