Hi,
I'm trying to UPDATE a table in an Access database using PHP and ODBC. Everything works fine until i try to use a variable in the WHERE statement of the SQL query:
//define SQL query
$sql="SELECT * FROM PatientDetails WHERE TraceNumber=AD1/2005";
ideally the query will use GET to obtain the tracenumber value, i.e., WHERE TraceNumber={$_GET['id']}, but this gives me the same error::
Warning: odbc_exec(): SQL error: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1., SQL state 07001 in SQLExecDirect in C:\Program Files\Apache Group\Apache2\htdocs\query.php on line 39
I've done some searching on this error and it seems it occurs when the fieldname doesn't match up with whats in the database, in the database the field name is "TraceNumber" but the SQL statement is "TraceNumber=SomeValue".
Is there any way around this problem??? Or can someone paste some more details on this error?
Thanks in advance,
Joe