Despite bypassing Cake's normal methods for retrieving information
from the DB, it's still going to return it to you in a manner
consistent with how data is usually returned from a model, one row or
not.
This actually makes sense as a lot of people generally use ->query()
to perform commands that don't fall into the realm of what Cake can
handle but still want the data returned in a nice, clean, similar way.
You could also do: Set::extract($this->query('SELECT NOW()'),
'0.0.now()'); to retrieve the data.
Then again, you could also just use PHP's date() function and not
worry about any of this.
On Oct 9, 8:26 am, "igor'OK" <[EMAIL PROTECTED]> wrote:
> Hi guys
> I do sql query for example $this->query('SELECT now()');
> and i get response like this
>
> Array
> (
> [0] => Array
> (
> [0] => Array
> (
> [now()] => 2008-10-09 17:16:21
> )
>
> )
>
> )
>
> Why not just return response in a single level array?
> of course i can get single level array using expression like this
>
> $result = $result[key($result)];
> $result = $result[key($result)];
>
> But i think there must be more intelligent way, can anyone help
> please?
> Point me where i can read more about it
>
> Thank you!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---