Jump to content

Display selected data in a table


klinmy

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.