I have php code that retrieve data from mysql DB, and print it in html table.

print "<table>";
$result=mysql_query("select fd1,fd2,fd3 from tbl");
for ($i = 0; $i < mysql_num_rows($result); ++$i)
$line = mysql_fetch_row($result);
print "<tr><td>$line[0]</td><td>$line[1]</td><td>$line[2]</td></tr>";
print "</table>";

I have no problem to implement above code, this html table contains three columns while each column has multiple lines(rows).

Now in html table I want to merge rows by using ROWSPAN in first column, when DB field "fd2=1", display DB values(one or more) in this merged cell, and leave the other two columns prints row by row. As on web browser data are printed from top to bottom, is it possible to print DB multiple records in merged cell?
Thanks for any response.

10 Years
Discussion Span
Last Post by mmonaco27

Yes what you are asking is very unclear. But the definate answer is: anything is possible!

It sounds like you just need to tinker a little more, possibly loading your query into a mutlidimentional array so that you can process them more than once.

Try posting a static HTML example of the results you'd like.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.