klinmy Posted May 14, 2009 Share Posted May 14, 2009 Hi, I would like to display the selected data in a table. echo "<tr><td>"; echo "Data1; echo "</td></tr>"; while ($row=mysql_fetch_assoc($result)) { echo "<tr><td>"; echo "$row["data1"]; echo "</td></tr>"; } -----some other codes------- echo "<tr><td>"; echo "Data3; echo "</td></tr>"; while ($row2=mysql_fetch_assoc($result)) { echo "<tr><td>"; echo "$row2["data3"]; echo "</td></tr>"; } The result I got is something like ths, Data1 12 4 1 2 3 Data3 5 4 2 6 4 Is there a way that i can make the table looks like this? Data1 Data2 12 5 4 4 1 2 2 6 3 4 Thanks in advance Link to comment https://forums.phpfreaks.com/topic/158086-display-selected-data-in-a-table/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.