查询数组中摸个字段的个数?
$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');<br /> echo "<table width=950 border='1px solid'>";<br /> echo "<tr><th>姓名</th><th>手机</th><th>性别</th></tr>";<br />while($row=mysql_fetch_assoc($r)){<br /> $shouji_arr=explode(',',$row['shouji']);<br /> $sex_arr=explode(',',$row['sex']);<br /> echo "<td colspan=3>订单号:".$row[orderid]." 状态:".$row['zhuangtai']."</td>";<br /> foreach(explode(',',$row['name']) as $k=>$v){<br /> echo "<tr>";<br /> echo "<td>$v</td><td>$shouji_arr[$k]</td><td>$sex_arr[$k]</td>";<br /> echo "</tr>";<br /> }<br />}<br />echo "</table>";
<td>$v</td><td>$shouji_arr[$k]</td><td>$sex_arr[$k]</td>