There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
UPDATE query is not working


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
Sujit Joshi's Avatar
Junior Member with 18 posts.
 
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
Senior Member with 400 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
Junior Member with 18 posts.
 
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
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?
Reply


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 06:42 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.