Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Search records with empty value with ORM
  • How can I do a search like this with ORM

    SELECT * FROM table_name WHERE field_name != '';

    I want to find records which one field does not have any value. 
    I tried the following with no success and I know why.

    Model_Table::query()->where('field_name', '!=', '')->get();

    Those two single quotes are enclosed by another quotes?
    How do I bypass this and execute a correct search?

  • HarroHarro
    Accepted Answer
    That ORM statement generates exactly that query. Single or double quotes are irrelevant. You can check that by dumping the last_query(), or by using the profiler (with DB profiling enabled).

Howdy, Stranger!

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

In this Discussion