odbc_exec

wxdqz

New Member
I have this code:

$search_query = AccessAddSlashes('SELECT * FROM Orders WHERE Customer = "' . $search_text . '";');

print($search_query);
$result_id = odbc_exec($connection_id, $search_query);

It doesn't display well here, but its simple. I'm using it with an access database via odbc but i keep getting this error:

Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2., SQL state 07001 in SQLExecDirect in c:\windows\desktop\search.php on line 29

the error comes from the odbc_exec call, but does NOT occur when the WHERE clause is taken out of the SQL statement. Any ideas?

Thanks,

Sonny
 
Back
Top