This topic is locked

From vertical to horizontal

5/18/2008 4:43:49 PM
PHPRunner General questions
V
vytb author

I have multiple records belonging to the same individuals. How to group them horizontally?
For example, the list would be following:

    1. a


    1. b


    1. c


    1. d
      I would need a result like
      1. 3...







  1. a b
  2. c
  3. d
    I don't know in advance the number of records for each individual...
    I would prefer MySQL solution and not PHP loops.
    A simple way would be to use constrains/counts for the primary keys which are different. However I am getting invalid use of 'group by' error. Limits can be used for all the table only. I need second, third,... highest values for each group.
    How to do this?

J
Jane 5/20/2008
V
vytb author 5/20/2008

Hi,

please check this thread:

http://www.asprunner.com/forums/index.php?showtopic=6221


Sorry Jane,
I don't get it... The link explains how to insert the headers between the groups. Thats OK. But how to distribute groups horizontally for each record/group?

J
Jane 5/21/2008

Vitas,
you need to edit templates in HTML mode on the Visual Editor tab.

For example replace field3 with your custom value - list of all values (a,b,c) in the List page: Before process event.
To select only unique values (1,2,3) use DISTINCT in the SQL query.

http://www.webcheatsheet.com/sql/interacti...ql_distinct.php