Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
As_array() in Query Builder
  • I'm trying to determine user's username, email and other data by knowing only username. Here is my method... It returns...
    Variable #1:
    array(1) {
    [0]=>
    array(2) {
    ["username"]=>
    string(8) "daGrevis"
    ["email"]=>
    string(18) "dagrevis@gmail.com"
    }
    }

    ...but I need 1D array... like myArray not myArray[0]. I know it's related to as_array(), because I asked this myself on stackoverflow.com some time ago... the problem is that I can't solve this problem. I don't get the idea how these problems should be solved! (
  • Quick and dirty, use
    $array = $result->as_array();
    return reset($array);
    

Howdy, Stranger!

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

In this Discussion