How to display multiple data from multiple rows in single row in mysql
===

I have a table that has multiple rows of data that belongs to individual users.
Eg:
           
                regno         course      score         session     semester
              03/01/02        Mth111       60            2            3
              03/01/02        MTH222       50            2            3
              03/04/05        MTH333       40            2            3
              03/04/05        MTH111       30            2            3

I want the values for a particular session and semester to be displayed  in one row per regno in this way:


          regno                    
        03/01/02            MTH111         MTH222
                              60             50

       03/04/05             MTH333          MTH111
                              40             30


I tried using group by....using a foreach loop with  mysql_fetch_assoc to get the column headers and a group by clause...but only one row showed. How can i resolve this.Thanks.
           
                          