Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
| Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old July 4th, 2005, 06:15 AM
Registered User
 
Join Date: Jul 2005
Location: Bangalore, Karnataka, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Sujit Joshi Send a message via Yahoo to Sujit Joshi
Default UPDATE query is not working

hello all, i'm new to this forum i have bigginner level experience..
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????
  #2 (permalink)  
Old July 6th, 2005, 04:07 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

This is how it should look. Do a echo $update just after this red line, and see what it contains.
Code:
$update = "UPDATE allocate3 SET WORKSHEDULE='" . $work . "',TIME='" . $now_date . "' WHERE auto_id='" . $id . "'";
$sql_result = odbc_exec($conn,$update);
Hope that helps.

_________________________
- Vijay G
Strive for Perfection


Similar Threads
Thread Thread Starter Forum Replies Last Post
DetailsView update not working. Andrew.Berry ASP.NET 2.0 Professional 6 April 22nd, 2008 11:23 AM
I solved insert query.now see this Update Query. amit_mande@yahoo.com VB.NET 2002/2003 Basics 2 September 21st, 2006 12:48 AM
Update Query Not Working Odifius BOOK: Beginning Access VBA 0 September 20th, 2006 11:33 AM
Update Code Not Working Odifius BOOK: Beginning Access VBA 0 September 19th, 2006 04:04 PM
Update not working... comicghozt ASP.NET 1.0 and 1.1 Basics 3 June 30th, 2006 03:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.