Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
How to rename columns in DB::select_array
  • Hello,

    I am returning an array and it fails on 'categories.name as category_name',
    Column not found: 1054 Unknown column 'categories.name
  • DB::select_array() uses the same syntax as the select() method:

    You pass an array of either strings (column names), or arrays (when you need an alias):

    ->select(array('id', array('name', 'alias')))-> ...

    will become

    SELECT `id`, `name` as `alias` ...
  • Thank you again. :)

Howdy, Stranger!

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

In this Discussion