Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7692691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:54:39+00:00 2026-05-31T20:54:39+00:00

I am trying to achieve a very simple goal, however it does not seem

  • 0

I am trying to achieve a very simple goal, however it does not seem to be working. I wish to use Kohana’s ORM and conditionally add certain parameters.

For instance:

$query = ORM::factory('user')
  ->where('foo', '=', 'bar');

if (isset($some_var))
  $query->where('field', '=', $some_var);

$query->find_all();

One would think this should work, but all I get from $query is a big fat nothing. Any suggestions I would greatly appreciate! Thanks.

EDIT:

The simple example on this Kohana page even shows a similar query:
http://kohanaframework.org/3.1/guide/orm/examples/simple

…But even when I create a ‘user’ model instance and then try to find_all() in a separate statement, I get nothing.

This works:

$query = ORM::factory('user')->find_all();

This doesn’t work:

$query = ORM::factory('user');
$query->find_all();

Possible bug??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T20:54:40+00:00Added an answer on May 31, 2026 at 8:54 pm

    In your example that works, you are assigning the value returned from find_all() to $query. While in the example that is not working, you are not assigning the value returned by find_all() at all.

    kohana framework

    $query = ORM::factory('user');
    $result = $query->find_all(); 
    // you may now loop over $result
    

    When you look over the api, you will see that find() and find_all() work differently.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to achieve a very simple thing in MATLAB. I have a
I'm very new to Redmine/Ruby trying to achieve a simple plugin that takes the
What I'm trying to achieve is very simple, but a bit difficult to explain:
I have been trying very hard to achieve rounded corners with IE6+jquery ui tabs.
I'm trying to put together a very simple REST-style interface for communicating with our
I'm trying to implement a very simple XML schema constraint. The idref attribute on
My question is a very simple one i'm sure. It's just I'm not quite
What I'm trying to achieve is simple. Now there's an extension already made called
I am trying to do a very simple thing. I want that when I
I am trying to build a very simple C++ program using the Maven NAR

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.