find("count") may return false in case of query error.
On Oct 10, 4:17 pm, rrd <[email protected]> wrote:
> <?php
> $uniqueId = md5($m['username'].mb_substr($m['message'], 0, 100));
> $isSaved = $this->Intercept->find('count',
> array(
> 'conditions'
> => array('there_id' => $uniqueId)
> ));
> ?>
>
> This is the code. I change nothing in the database table, and
> sometimes $isSaved wil be 1 (integer) and sometimes boolean false.
>
> I changed if(!$isSaved) to if($isSaved === 0) but it took me 5 hours
> to figure out what is wrong. It seems to me as a CakePHP bug. As I
> understand find count always should return an integer.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---