Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
get first of has_many
  • hi
    my model has_many files (Like articles has many images)
    and many other relation(Category, User, Tag, ....)
    i want to show first file of has many in list
    how can i do that?


  • HarroHarro
    Accepted Answer
    Run the query the other way around, like "show the first image that has "this" article as it's parent". Child records of an object are always fetched as a complete set, even if you only want to display one of them.

Howdy, Stranger!

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

In this Discussion