Hello All-
I need help on a Select statement. I have this...
When I run the page I get this...
What am I doing wrong? I have printed the Select statement and it does get a value like so...
Do I have to wrap a convert function around the requested id? I'm not really a PHP person, I concentrate mainly on ASP so I'm a little confused. Do I have the syntax correct? Any help would be great.
Also, as far as the Access Database goes the "id" field is set as "Autonumber " to increment and is the primary key of the table.
I need help on a Select statement. I have this...
Code:
<?php
$conn=odbc_connect('databasename','','');
if (!$conn)
{exit("Connection Failed: " . $conn);}
$sql="SELECT * FROM tablename where id = '" . $_REQUEST['id'] . "'";
echo "$sql";
$rs=odbc_exec($conn,$sql);
?>
Code:
PHP Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression., SQL state 22005 in SQLExecDirect in C:\yada\yada\yada.php on line 27
Code:
SELECT * FROM tablename where id = '99999'
Also, as far as the Access Database goes the "id" field is set as "Autonumber " to increment and is the primary key of the table.
Comment