UPDATE query is not working

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Sujit Joshi

Thread Starter
Joined
Jun 24, 2005
Messages
18
hello all,
i'm using PHP and MS ACCESS database now i'm updating the table in a while loop. but it is giving error like...

Warning: odbc_exec(): SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement., SQL state 37000 in SQLExecDirect in c:\apache\htdocs\allocater.php

and my update query is look like this....
$update = "UPDATE allocate3 SET WORKSHEDULE='$work',TIME='$now_date' WHERE auto_id='$id'";
$sql_result = odbc_exec($conn,$update);

what may be the problem please help me regarding this????
 
Joined
Apr 1, 2005
Messages
394
run the update query in access, it should give you a better error message. But as a first guess i would say its your "auto_id='$id'" im assuming the auto_id is an AutoNumber or Number so it shouldnt have single quotes around the val "auto_id=$id"
 

Sujit Joshi

Thread Starter
Joined
Jun 24, 2005
Messages
18
yes you are correct "auto_id" is AutoNumber. i'll try taking out the quotes around the value of auto_id. but i think that is not the problem....
 
Joined
Mar 28, 2001
Messages
781
Try writing your SQL string to the browser before actually attempting to update the DB.

Are the values you expected in it?
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top