Wrox Programmer Forums
| 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
 
Old October 7th, 2003, 08:24 AM
Authorized User
 
Join Date: Sep 2003
Location: , , .
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQL and Microsoft

Trying to do an update with the following code:
$query=odbc_exec($odbc, " UPDATE phpInventory set NumberOnHand=$NumberUsed WHERE

ControlNumber like '$%ControlNumber%' and PartNumber like '$%PartNumber%' ");
$result = odbc_exec($odbc,$query);

I have verified that the connection string works(which is in an include statement)


Getting the following error: Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'., SQL state 37000 in SQLExecDirect in d:\inetpub\wwwroot\sparepartsinv\action3.php on line 16



 
Old October 7th, 2003, 08:30 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi, you've got a space before 'UPDATE'. is that meant to be there?
 
Old October 7th, 2003, 09:20 AM
Authorized User
 
Join Date: Sep 2003
Location: , , .
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks that did it





Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert SQL to Microsoft Query tgates Excel VBA 0 April 18th, 2008 01:49 PM
Microsoft SQL Server 2005. explore_asp SQL Server 2005 0 August 29th, 2007 03:29 AM
Microsoft SQL isapi extension ERROR - FIX proslambano BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 January 6th, 2007 10:25 AM
Microsoft SQL rowsen BOOK: Beginning SQL 2 May 18th, 2005 02:24 PM
SQl and Microsoft skicrud PHP Databases 1 October 7th, 2003 11:38 AM





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