From: Hank M. <hma...@gm...> - 2007-01-09 00:38:57
|
Depending on your data structure and mysql version you might be able to use a sub-select taking only Agencies 'having' 2 or more CMHSP records. Failing that, you'd have to separate your code from your rendering (a good idea anyway) ... do a simple record retrieval into an array and maintain a counter, then only display records that have 2 or more CMHSPs Forgive me I've so long ago written a mysql db object that I don't remember the native calls off the cuff ... while($db->next_record()) { extract($db->record); // dumps all the fields to local variables $records[]=$db->record; // preserves your record set that you'll later iterate $CMHSP_counter[$agency][$cmhsp]++; } Now in your view you have the same processing loop you have though you test for $CMHSP_counter[$agency][$cmhsp] > 1 for your optional code. Optionally, you could also put the 'if' statement around the array assignment such that only records tripping the threshold are put into the $records array ... On 1/8/07, Roderick Thomas <tho...@ms...> wrote: > > Please click the link below: > > http://www.sigmaupsilon-omegapsiphi.org/SAP/Agency-CMHSP_ServiceReport.php > > > Notice the CMHSPs highlighted in red font. I only want to display data > for those Service Agencies that have more than 1 CMHSP. > > My script is attached. Thanks for your time. > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > _______________________________________________ > chiPHPug-discuss mailing list > chi...@li... > https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss > > > > |