我需要将表中的数据库记录显示为行,但它显示为不同的表。我正在使用代码点火器。请帮帮我。
这是我的代码 http://kl1p.com/Takn
最佳答案
http://ellislab.com/codeigniter/user-guide/database/active_record.html
Codeigniter 没有数据 GridView ,如果这是你的问题,最好的方法(也是我知道的唯一方法)是:
$query = $this->db->get('mytable');
echo "<table>
<th>
<td>Title</td>
</th>
<tbody>
<tr>";
foreach ($query->result() as $row){
echo "<td>".$row->title."</td>";
}
echo " </tr>
</tbody>
</table>";
关于php - 如何在表格行中显示数据库记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23499791/