MySQL Forums
Forum List  »  Newbie

Re: How do I combine 3 queries into one
Posted by: Rick James
Date: April 13, 2009 10:26PM

I'm still guessing what you what. You have not explained "stuff".

You should be able to do only one operation to get everything into item_cat_associations.

INSERT INTO stuff...
$item_id = insert_id();

INSERT INTO item_cat_associations SET
    item_id = $item_id, 
    cat_id = '$HTTP_POST_VARS[cat]'
    sub_id = ( SELECT subcategory.sub_id
          FROM subcategory
          WHERE subcategory='$HTTP_POST_VARS[subcat]' )
;

Options: ReplyQuote


Subject
Written By
Posted
Re: How do I combine 3 queries into one
April 13, 2009 10:26PM


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.