Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Software Development Software Development
Search Search
Search for:
Tech Support Guy > > >

UPDATE query is not working


(!)

Sujit Joshi's Avatar
Sujit Joshi Sujit Joshi is offline
Junior Member with 18 posts.
THREAD STARTER
 
Join Date: Jun 2005
Experience: Beginner
04-Jul-2005, 05:13 AM #1
Question UPDATE query is not working
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????
GCDude's Avatar
GCDude GCDude is offline
Senior Member with 394 posts.
 
Join Date: Apr 2005
Location: Brighton, UK
Experience: Possibly Competent
04-Jul-2005, 07:03 AM #2
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's Avatar
Sujit Joshi Sujit Joshi is offline
Junior Member with 18 posts.
THREAD STARTER
 
Join Date: Jun 2005
Experience: Beginner
04-Jul-2005, 07:20 AM #3
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....
Mithrilhall's Avatar
Mithrilhall Mithrilhall is offline
Senior Member with 781 posts.
 
Join Date: Mar 2001
Location: AU Microscopii
Experience: Studying for my CCNA
04-Jul-2005, 11:01 PM #4
Try writing your SQL string to the browser before actually attempting to update the DB.

Are the values you expected in it?
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
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.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑