开发者

kohana next iterator

I am using the next() iterator in order to get the second element from a colection, but this next() returns me an oject like: Resource id #115 . the code:

   $first_two = $product-&开发者_如何学编程gt;images->limit(2)->find_all();
   $second = next($first_two);

and next($first_two); gives: Resource id #115 for example.

How can i make it show just 115 (only the id?)

i need it for making a query after this id.

Thank you!


Try $second->id? If you're using ORM, which I think you are, then find_all() returns Database_result trough which you can iterate.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜