CodingBiz更新:
我把它放在我的代码中:
for($i=1;$i<=$numRows;$i++) {
$output .= '
';$row = $this->fetchAssoc($result);
$colRow = $this->fetchAssoc($colResult);
foreach($colRow as $colName) {
$output .= "
".$row[$colName]."";}
$output .= '
';}
代替
for($i=1;$i<=$numRows;$i++) {
$output .= '
';$row = $this->fetchAssoc($result);
for($j=1;$j<=$colNumRows;$j++) {
$colRow = $this->fetchAssoc($colResult);
$output .= "
".$row[$colRow["COLUMN_NAME"]]."";}
$output .= '
';}
这有什么不对吗?
原帖:
我正在PHP类中编写一个函数来在表中显示查询结果.我自己并没有构建任何表,我希望使用PHP完成所有事情.