Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
loop sql query?
  • What is the best way to loop through a query result and then for each result run another query based on result information. Example: Query 1: Names Jim
    -> Query 2: Colors
    -- Red
    -- Blue
    -- Black Bob
    -> Query 2: Colors
    -- Green
    -- Purple
    -- Pink Im not sure how to get information like this from the model to the controller to the view. Where do I set up the looping pattern? In models? Or the controller? Maybe its just a more advanced sql join and its all done in one query? Noob to fuel. Thnx.
  • If you code database queries by hand, a join is the obvious answer. If you use the ORM, use relations to fetch related information.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion