943,940 Members | Top Members by Rank

Ad:
  • MySQL Discussion Thread
  • Unsolved
  • Views: 7503
  • MySQL RSS
Dec 3rd, 2004
0

UPDATE syntax error

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mikeps is offline Offline
3 posts
since Dec 2004
Dec 9th, 2004
0

Re: UPDATE syntax error

Quote 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?
Reputation Points: 11
Solved Threads: 1
Light Poster
starsunited is offline Offline
44 posts
since Dec 2004
Dec 10th, 2004
0

Re: UPDATE syntax error

Quote 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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mikeps is offline Offline
3 posts
since Dec 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MySQL Forum Timeline: any experiences with embedded mysql?
Next Thread in MySQL Forum Timeline: Checking existance of table





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC