| | |
UPDATE syntax error
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Dec 2004
Posts: 3
Reputation:
Solved Threads: 0
I am getting a syntax error report from an UPDATE using two tables in a MYSQL db. :cry: This must be my mistake but I can't see it and have changed around many times now. Any ideas to help me resolve this welcome.
Statement:
UPDATE hole,tee SET hole.hx=tee.tnx where hole.hid=tee.hid;
Error Report:
error in your SQL syntax near 'tee SET hole.hx=tee.tnx where hole.hid=tee.hid' at line 1
Server:
Server running version 4.3.8 of PHP on the Linux operating system
Statement:
UPDATE hole,tee SET hole.hx=tee.tnx where hole.hid=tee.hid;
Error Report:
error in your SQL syntax near 'tee SET hole.hx=tee.tnx where hole.hid=tee.hid' at line 1
Server:
Server running version 4.3.8 of PHP on the Linux operating system
•
•
•
•
Originally Posted by mikeps
I am getting a syntax error report from an UPDATE using two tables in a MYSQL db. :cry: This must be my mistake but I can't see it and have changed around many times now. Any ideas to help me resolve this welcome.
Statement:
UPDATE hole,tee SET hole.hx=tee.tnx where hole.hid=tee.hid;
Error Report:
error in your SQL syntax near 'tee SET hole.hx=tee.tnx where hole.hid=tee.hid' at line 1
Server:
Server running version 4.3.8 of PHP on the Linux operating system
•
•
Join Date: Dec 2004
Posts: 3
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by starsunited
you want to update two tables at one go?
I have used two queries to get round it but I want to use one. It only updates one table but it uses another table in the condition. In the syntax I think it is called a multi-tabe update. I think you could extend the syntax to update fields in both tables but I just used the simple case to make the post so the problem was clear.
I tried the update on a local server and it worked so I am wondering if the error message is mis-leading?
Thanks for your post.
![]() |
Similar Threads
- Syntax error in UPDATE statement. (VB.NET)
- Update syntax error (VB.NET)
- Syntax error on update database code (VB.NET)
- MySQL/PHP UPDATE Syntax error (MySQL)
- Invalid Syntax Error (Viruses, Spyware and other Nasties)
Other Threads in the MySQL Forum
- Previous Thread: any experiences with embedded mysql?
- Next Thread: Checking existance of table
| Thread Tools | Search this Thread |
agplv3 alfresco amazon api artisticlicense aws bizspark breathalyzer camparingtocolumns changingprices cmg communityjournalism contentmanagement contractors copyright count court crm database design developer development distinct drupal dui ec2 email enterprise eudora facebook form foss gartner gnu government gpl greenit groklaw groupware hiring hyperic images innerjoins insert ip joebrockmeier join journalism keyword keywords kickfire laptop law legal license licensing linux maintenance managing mariadb matchingcolumns metron micromanage microsoft microsoftexchange mindtouch montywidenius mozilla music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opendatabasealliance opensource oracle penelope php priceupdating query referencedesign reorderingcolumns resultset saas select sharepoint simpledb sourcecode spotify sql sugarcrm syntax techsupport thunderbird transparency





