# PHP and form variables

**URL:** https://forum.kirupa.com/t/php-and-form-variables/321096
**Category:** programming
**Created:** [April 10, 2011, 7:47pm UTC](https://forum.kirupa.com/t/php-and-form-variables/321096 "2011-04-10T19:47:22Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![zzxjoanw](https://avatars.discourse-cdn.com/v4/letter/z/b5e925/32.png) [@zzxjoanw](https://forum.kirupa.com/u/zzxjoanw)
#### Post date: [April 10, 2011, 7:47pm UTC](https://forum.kirupa.com/t/php-and-form-variables/321096/1 "2011-04-10T19:47:22Z")

</div>

I’m trying to insert a record using the following code:

```php
if($hasError==0)
{
  $time = $_POST['hour'] . ":" . $_POST['minute'];
  $sql="INSERT INTO res_tblReservation(resDate,time,numGuests,
     email) VALUES('$_POST[date]','$time','$_POST[numPeople]',
     '$_POST[email]')";
  $qOutput=odbc_exec($conn,$sql) or die(mysql_error());
  print "Success!";
}

```

Execution gets as far as the odbc\_exec function before returning the following error:

**Warning** : odbc\_exec() [[function.odbc-exec](http://www.dcwebdev.net/reservationizer/function.odbc-exec)]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement., SQL state 37000 in SQLExecDirect in **D:\Inetpub\dcwebdev\reservationizer\main.php** on line **128**

I’m sure I’m missing something obvious. Any help would be appreciated.

**Edit:** I found the answer. The issue was that I had named one of the database columns using a reserved word.
