Query the number of touch fields in the array? $ R = mysql_query ('select & nbsp; orderid, zhuangtai, group_concat ('name') & nbsp; as & nbsp; name, group_concat ('shouji ') & how many fields does the nb search array contain?
$ R = mysql_query ('select orderid, zhuangtai, group_concat ('name') as name, group_concat ('shouji ') as shouji, group_concat ('sex ') as sex from 'order' group by orderid ');
Echo"
";
Echo"NameMobile phoneGender";
While ($ row = mysql_fetch_assoc ($ r )){
$ Shouji_arr = explode (',', $ row ['shouji ']);
$ Sex_arr = explode (',', $ row ['sex']);
Echo"
Order Number: ". $ row [orderid]." status: ". $ row ['zhuangtai']."";
Foreach (explode (',', $ row ['name']) as $ k => $ v ){
Echo"";
Echo"$ V$ Shouji_arr [$ k]$ Sex_arr [$ k]";
Echo"";
}
}
Echo"";
This is a loop output column. I want to know how to get it.
$v$shouji_arr[$k]$sex_arr[$k]
Where is the number of $ v? After the actual output is displayedHow many rows are there? Because I need to add a merged cell, similar Merged cellsBecause I don't know this groupThe number of rows in the table, that is, the number of $ v. Therefore, we do not know the value of rowspan!
I don't know what I said, but you can't hear it clearly. this is the foreach output display, but you cannot determine the number of output rows. you need to get the number of $ v because one $ v occupies one row! Mysql php table border
------ Solution --------------------
$ T = explode (',', $ row ['name']);
$ S =" Merged cell content";
Foreach ($ t as $ k => $ v ){
Echo"". $ S;
Echo"$ V$ Shouji_arr [$ k]$ Sex_arr [$ k]";
Echo"";
$ S = ''; // clear after the output
}