•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 426,898 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,359 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums
Views: 6091 | Replies: 2
![]() |
•
•
Join Date: Dec 2004
Posts: 3
Reputation:
Rep Power: 0
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
you want to update two tables at one go?
•
•
Join Date: Dec 2004
Posts: 3
Reputation:
Rep Power: 0
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.
![]() |
•
•
•
•
•
•
•
•
DaniWeb MySQL Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Help Needed Parse error: syntax error (PHP)
- Helllppp..> <<invalid Syntax Error>> (Viruses, Spyware and other Nasties)
- IE Syntax Error and Can“t browse some sites (Viruses, Spyware and other Nasties)
- Invalid Syntax Error (Viruses, Spyware and other Nasties)
- Parse error, syntax error, Forbids declaration (C++)
Other Threads in the MySQL Forum
- Previous Thread: any experiences with embedded mysql?
- Next Thread: Checking existance of table


Linear Mode