On Jan 11, 2008 10:26 PM, Pablo Viojo <[EMAIL PROTECTED]> wrote: > Try Model::findCount[1] > > $this->Customer->findCount(); > > > -- > Pablo Viojo > [EMAIL PROTECTED] > http://pviojo.net > > [1] > http://api.cakephp.org/1.2/class_model.html#0978aba07f5d196079d7518a99bcfa86 > > > > > > On Jan 11, 2008 10:36 AM, Chris Hartjes <[EMAIL PROTECTED]> wrote: > > > > > On Jan 10, 2008 11:13 PM, Dr. Tarique Sani <[EMAIL PROTECTED]> > > wrote: > > > > > > On Jan 11, 2008 8:26 AM, Made Aditiya Jaya < [EMAIL PROTECTED]> wrote: > > > > hi all i need help.. > > > > how display result in view with $this->$Modelname->Query("select > > > > count(Customer.id ) from customers as Customer"); ??? > > > > i can't display the field that i count.. > > > > > > Try giving an alias for the counted field and then do a print_r in > > > your view to figure out what is the structure of the array > > > > Or, you could always do this to figure out what field it's coming back > > as, assuming you haven't done this already. > > > > $result = $this->$Modelname->Query("select count( Customer.id) from > > customers as Customer"); > > print_r($result); > > > > I'm pretty sure you can do this same query using a find(), but the > > syntax escapes me this early in the morning. > > > > -- > > Chris Hartjes > > Internet Loudmouth > > Motto for 2008: "Moving from herding elephants to handling snakes..." > > @TheKeyBoard: http://www.littlehart.net/atthekeyboard > > > > > > > > > > thank's all, i finally found the answer, in the past i was confuse using debug function to see the result array in view ha..ha.., i prefered using query function because i'm using more than 2 normalization table in my relation, finally thank's again
sorry my english not good, i'm from indonesia --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
