使用以下代码时,我将值放入视图中:
echo '<pre>';print_r($result1['organization_answer_rating1']);exit;
输出为:
Array
(
[0] => stdClass Object
(
[organization_answer_rating1] => 2.7500
)
)
但是当如下使用它时,它被输出为一个数组:
<table class="footable">
<thead>
<tr>
<th style="text-align:center;">Organizational Mean</th>
<th style="text-align:center;">Workgroup Mean</th>
</tr>
</thead>
<tbody>
<?php
echo "<td style='text-align:center;'><span>".$result1['organization_answer_rating1']."</span></td>";
echo "<td style='text-align:center;'><span>".$result1['workgroup_answer_rating1']."</span></td>";
?>
</tbody>
</table>
这是什么原因?你能告诉我我做错了什么吗?谢谢