我想使用一个 MySQL 查询创建一个包含 2 个动态列的表。我能够制作第一行列,但第二行只是空白。有任何想法吗?这是我当前的代码:
<?php
$query_dates ="SELECT uploadedby, count(item) as item, date_format(uploaddate, '%m-%d-%y') as date FROM `imsexport` WHERE uploadedby='Gerry Dellosa' and uploaddate between '2012-12-25' and '2013-01-15' GROUP BY date ORDER BY uploaddate ASC";
$result = mysql_query($query_dates,$prepress) or die(mysql_error());
$row_dates = mysql_fetch_assoc($result);
?>
<html>
<head>
</head>
<body>
<table width="200" border="1">
<tr>
<td>NAME</td>
<?php do{?>
<td><?php echo $row_dates['date']?></td>
<?php } while ($row_dates = mysql_fetch_assoc($result)); ?>
</tr>
<tr>//This is the second row set of dynamic columns
<?php do{?>
<td><?php echo $row_dates['date']?></td>
<?php } while ($row_dates = mysql_fetch_assoc($result)); ?>
</tr>
</table>
</body>
</html>