retrieve data from access using php odbc throws error in parameter line
<p>I'm trying to extract data from a table in access database using odbc connection and php. I have written the code below but it gives error <strong>"Uncaught exception 'com_exception' with message '<b>Source:</b> Microsoft OLE DB Provider for ODBC Drivers<br/><b>Description:</b> [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'table1.col_date"</strong></p>

<pre><code>&lt;?php $cn = new com("ADODB.Connection");
 $rs = new com("ADODB.Recordset");

$cn-&gt;open("dsn=odbcconnection");
?&gt;
&lt;form action = "thispage.php" method = "post"&gt;
Enter Date : &lt;input type = "text" name = "datadate" /&gt;
&lt;input type = "submit" name = "submit" value = "submit" /&gt; 
&lt;/form&gt;
&lt;?php
$datadate = isset($_REQUEST['datadate']) ? $_REQUEST['datadate'] : null; ?&gt;

&lt;?php $sql = "select col_date, sum(qty1), sum(qty2) from table1
              where  table1.col_date = '".$datadate."'
              group by col_date
              order by col_date";

// Execute query
$rs = $cn-&gt;execute($sql);
</code></pre>

<p>I think there is a problem in only parameter line table1.col_date = $datadate because when I replace $datadate with static date like table1.col_date = #05/08/2012# , it displays output correctly for the date</p>
