Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Print out all data
  • Hey,

    i have an database structure like this:

    id | link | alias | parent
    --------------------------------
    1  | abc | abc   | 0
    2  | abc | abc1 | 1

    how can i print just all aliases out? So that i have an array like array('alias' => 'abc', 'alias' => 'abc1');

    This dont work with:

    $query = DB::select('*')->from('navigation')->execute()->as_array();

    foreach($query as $key => $val){
    foreach($val as $key => $val){
    echo $val['alias'];
    }
    }
  • you can do

    ->as_array('id', 'alias')

    which will give you an indexed array with id => alias

Howdy, Stranger!

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

In this Discussion