ODBC: SQL insert problem
| From: | Budgee) | Date: | Wed, 11 Oct 2000 12:34:37 +0000 |
| Subject: | ODBC: SQL insert problem | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-3145@lists.php.net to get a copy of this message | ||
Hi All
The following code returns the error listed under the code. Any
ideas? I haven't used the ODBC function for inserting info into
Access before so I could well be wrong.
<?
$conn=odbc_connect("glenwood","","");
if ($submit) {
$sql="insert into headmaster (title, date, content) values ('$title',
'$date', '$content')";
$result = odbc_exec($conn,$sql);
} else {
?>
<form method="post" action="<?echo $PHP_SELF;?>">
<table>
<tr><td>Title: </td><td><input type="text"
name="date"></td></tr>
<tr><td>Date: </td><td><input type="text"
name="opponents"></td></tr>
<tr><td> </td><td><TEXTAREA></TEXTAREA></tr>
<tr><td><input type="submit"
name="submit"></td></tr>
</tr>
</table>
</form>
<?
}
?>
Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver]
Syntax error in INSERT INTO statement., SQL state 37000 in
SQLExecDirect in c:\inetpub\wwwroot\otherstuff\headmaster.php
on line 6
Warwick Chapman (1999)
Assistant IT Manager
Glenwood High School, Durban, South Africa
031 2055241
083 7797094
www.glenwoodhighschool.co.za