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, 04: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, 06: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"
__________________
GameConfig - CodeIndex - Niris
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, 06: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, 10: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?
__________________
*******************************
Registered Linux Users #437006


+ Desktop +
Linux - Kubuntu 6.10 / OS: Windows XP (Pro.)
MB: Shuttle : Model SN95G5
Processor: AMD 64 Athlon 3500 (Socket 939)
Geforce 7600GS 512MB
RAM: 2GB
Hard drive: 2 x 250Gb SATA150 (16Mb Cache)
External HD: 200Gb
Listening to...

Other Operating Systems:
-- Windows 2003 Standard Server
-- Windows 2005 MCE
-- Linux (Asterisk@Home)
*******************************
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.


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

Forum Jump

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