Link to home
Start Free TrialLog in
Avatar of David Schure
David Schure

asked on

Table needs one column - many rows

I need the info to be in one column many rows.

<div>
      <table>             <tr>                 <th>Bill from:</th>             </tr>          <?php   // LOOP TILL END OF DATA                  while($rows=$result->fetch_assoc())                 {              ?>             <tr>                 <td><?php echo $rows['therapist_name'];?></td>                 <td><?php echo $rows['therapist_street'];?></td>                 <td><?php echo $rows['therapist_city'];?></td>                 <td><?php echo $rows['therapist_state'];?></td>                 <td><?php echo $rows['therapist_zip_code'];?></td>             </tr>             <?php                 }              ?>              </table></div>

Open in new window

User generated imageIt should read..

Bill from:

Dr. Brent Grundry

Rip Way

New York City

New York

20402

Avatar of David Schure
David Schure

ASKER

This seems to work. Not sure if it's the best way to do this though.
<div>
      <table>
            <tr>
                <th>Bill from:</th>
            </tr>
         <?php   // LOOP TILL END OF DATA 
                while($rows=$result->fetch_assoc())
                {
             ?>
            <tr>
                <td><?php echo $rows['therapist_name'];?><br>
                <?php echo $rows['therapist_street'];?><br>
                  <?php echo $rows['therapist_city'];?><br>
                <?php echo $rows['therapist_state'];?><br>
                <?php echo $rows['therapist_zip_code'];?></td>
            </tr>
            <?php
                }
             ?>
             </table></div>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial