Loading ...
Sorry, an error occurred while loading the content.

Re: [phpXperts] Displaying HTML

Expand Messages
  • Bipool
    You can tryl following ways: 1. Make a dynamic array from db result.
    Message 1 of 2 , Mar 23, 2008
    • 0 Attachment
      You can tryl following ways:
         1. Make a dynamic array from db result.
           <?
               $arrMember = array();
               $arrResult = array();
               while($row = mysql_fetch_array($result))
                {
                    $arrResult[$row['test_name']][$row['member_id']] = $row['score'];
                    if(!isset($arrMember[$row['member_id']]))
                    {
                        $arrMember[$row['member_id']] = $row['member_name']
                    }
                
                }
           ?

         2. Then using list-each loop, you can easily make your table.
        
        
         Thanks

      On Wed, Mar 19, 2008 at 8:51 AM, shivam0101 <shivam0101@...> wrote:

      I have a table and its structure is,
      member_id
      first_name
      last_name
      test_name
      score
      test_name

      I want to display the values in the below format.

      In the first row,
      Members> member1 member2 member3 member n

      Members> is static text. member1, member2...member..n are dynamic

      In the second row,
      Tests V - - - -

      Tests V is static text.

      In the third row,

      test1 m1_t1_score m2_t1_score m3_t1_score mn_t1_score

      test1 is dynamic test name. m1_t1_score, m2_t1_score....mn_t1_score
      are scores of members in test1

      in the fourth row,
      test2 m1_t2_score m2_t2_score m3_t2_score mn_t2_score

      test2 is dynamic test name. m1_t2_score, m2_t2_score ....mn_t2_score
      are scores of members in test2

      This pattern continues till test n.

      Thanks


    Your message has been successfully submitted and would be delivered to recipients shortly.