MySQL Forums
Forum List  »  Newbie

Re: Can this be done in MySQL functions or is PHP best?
Posted by: Peter Brawley
Date: February 24, 2015 08:46PM

You describe a graph or hierarchy. You might want to look at http://www.artfulsoftware.com/mysqlbook/sampler/mysqled1ch20.html.

If you impose strict limits on the possible depth of any recipe tree, you can write a generic query that covers all cases---basically, given N possible levels you will need N-1 joins.

Without such a limit, you need recursion to query such a system, so you need a MySQL stored procedure or a language like the one you're using.

Options: ReplyQuote


Subject
Written By
Posted
Re: Can this be done in MySQL functions or is PHP best?
February 24, 2015 08:46PM


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.