MySQL UPDATE query
I'm kinda new at this so if anybody could help me out i'd really appreciate it.
Ok basically i've got this, three tables
1. maps
2. posts
3. posts_text
I want to update a field "post_severity" in my "maps" table based on its "forum id" where "forum_id" is equal to the "forum_id" from "posts" table,forum_id is based on "post_id", where "post_id" from the "posts" table is equal to "post_id" from the "posts_text" table.
This is what i've come up with so far
"UPDATE maps SET post_severity = '$post_severity' where forum_id = (SELECT posts.forum_id FROM posts_text, maps, posts WHERE posts.post_id = $post_id and posts_text.post_id = $post_id and phpbb_posts.forum_id = maps.forum_id)";
I get an error saying there is an error with my sql syntax near "=(SELECT ...)
Subject
Written By
Posted
MySQL UPDATE query
March 19, 2005 05:00PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.