I have found a solution in this way:
$post['Post']['haswarnings'] = count($this->Warning->query("SELECT *
FROM `db`.`warnings` WHERE `post_id` ='".$post_id."'"));
Thank you, anyhow!
On 7 Ago, 01:32, albe <[email protected]> wrote:
> Hi everybody!
> maybe my problem is banal but I really don't know how to solve it:
>
> I wrote a query in a controller and put the result in a variable, in
> this way:
>
> $variable['Model']['field'] = ($this->Model2->query("SELECT COUNT
> ( * )...");
>
> The result of the query is something like this:
>
> Array
> (
> [0] => Array
> (
> [0] => Array
> (
> [COUNT( * )] => 1
> )
>
> )
>
> )
>
> Since I have to use this result in the relative view in order to make
> comparisons (if $variable.Model.field > 0) I need the PURE NUMBER,
> cleaned by the structure posted above.
> Otherwise the comparisons wouldn't be correct!
> Thank you in advance...
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---