FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Array count for each value in turn syntax?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Array count for each value in turn syntax? [message #169866 is a reply to message #169864] Tue, 28 September 2010 23:44 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 9/28/2010 7:41 PM, GarryJones wrote:
> An array contains the values 109,110,117
>
> The table contains
>
> ItemTypeCode - ItemData
>
> 109 njj
> 109 jfdjf
> 109 mdmd
> 109 jdjd
> 110 jf
> 110 jfjf
> 117 jgjg
> 117 jfjfjf
> 118 nfnf
>
> I want to use the array to give me the results of how many there are
> of each type
>
> So the output would be
> 109 = 4
> 110 = 2
> 117 = 2
> (in this case the entries for type 118 are not displayed because 118
> it not in the array)
>
> The table data is just an example, in my actual table its a few more
> columns.
>
> I plan to show these in a table with bold row headings with
> statistical data before the actual data rows
>
> The row headings will need to contain the number of data rows in the
> following data rows belonging to its type.
>
> I can run through the array and use a counter, then output the number
> then run through the array again to display the data. I am guessing I
> don't have to do that, surely these is some kind of "how many are" php
> command? But I am stuck here.
>
> Any help greatly appreciated.
>
> Garry Jones
> Sweden

Sounds like you need to learn to use a SQL database.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Iterative interfacing between client and server
Next Topic: Problems modifying date using regex
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 03:07:51 GMT 2024

Total time taken to generate the page: 0.04426 seconds