Alright.. I've spent most of my morning trying to figure this out, and I am a bit of a N00b at all of this so please don't critisize if Im doing something rediculously stupid.
I'm trying to update 2 fields in a database I created with access and registered in the System DSN of OBDC. At this point I really don't care what fields I'm updating, I just want them to update.
I've been searching relentlessly all over the internet for an answer, interestingly enough A LOT of other ppl have been having the same problem... only I've not found a single answer.
This is the statement I'm using as my query:
(in php)
$sql = "UPDATE users SET tempIP = \"666\", tempSessionID = \"777\" WHERE userID = 'someguy' ";
echo $sql;
odbc_exec($connection, $sql) or die("Incorrect Query statement.");
when I run the page and look at the out put from the echo statment the query looks fine:
UPDATE users SET tempIP = "666", tempSessionID = "777" WHERE userID = 'someguy'
if I copy and paste it into access it runs fine.
but never the less I continue to get this error on my page:
Warning: odbc_exec(): SQL error: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2., SQL state 07001 in SQLExecDirect in D:\MyFolder\NewWebsite\includes\objects\test_userauthenticationtool.php on line 34
Incorrect Query statement.
where line 34 is:
odbc_exec($connection, $sql) or die("Incorrect Query statement.");
Strangely enough I've had success already using this perticular table with the select statement:
SELECT * FROM users
that works just fine... but with UPDATE I'm having absolutely no luck.
If anyone could help me with this, I've tried switching double quotes to single quotes, I've tried using variables... it seems like I've tried just about everything but it still wont work.
Please help me
thanks.