[EMAIL PROTECTED] wrote:
> Can you give me a litte bit more explaination on how to make it in the
> model?
Somethign like this a new function in the resultstat model:
function sg() {
return $this->findAll("a=b", "Resultat.id , IF ( Resultat.message IS
NULL , NULL , 1)");
look the findAll in the manual (I don't try it, but I hope it is works).
}
>
> thanks
>
> On 8 fév, 12:23, Ámon Tamás <[EMAIL PROTECTED]> wrote:
>> [EMAIL PROTECTED] wrote:
>>> I'm trying to execute a query like this one :
>>> SELECT Resultat.id , IF ( Resultat.message IS NULL , NULL , 1)
>>> FROM `resultats` AS `Resultat`
>>> WHERE ...
>>> or
>>> SELECT Resultat.id , LENGTH(Resultat.message)
>>> FROM `resultats` AS `Resultat`
>>> WHERE ...
>>> and to return the result as Array of records
>>> I know this is mysql specific fonction and that wouldn't work on
>>> another dbengine but this is a performance problem : the message field
>>> is a text one and could be very long and everything I need to know if
>>> it is empty or not.
>>> I can do this by merging 2 result but that's not really like usual
>>> cake's magic.
>> You can make it in model functions, but this is working only with mysql.
>> Maybe you can make more models if you want to use with more db engines.
>>
>> --
>> Ámon Tamáshttp://linkfelho.amon.hu
>
>
> >
>
--
Ámon Tamás
http://linkfelho.amon.hu
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---