|
Array
(
[0] => Array
(
[id] => 1
[username] => 123456
[password] => 123456
)
[1] => Array
(
[id] => 2
[username] => 张三
[password] => 123456
)
[2] => Array
(
[id] => 3
[username] => 李四
[password] => 123456
)
)
控制器:
$this->load->view('admin/login',$result);
视图:
<table>
<thead>
<tr>
<td>序号</td>
<td>用户名</td>
<td>密码</td>
</tr>
<?php foreach($result as $itrm): ?>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<?php endforeach;?>
</thead>
</table>
报错:
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: result
Filename: admin/login.php
Line Number: 83
|
|