我正在尝试从数据库中检索一些值并将其放入带有 codeigniter 的表中,但它似乎不起作用?
这是我的模型
function getlogrecords(){
$query = $this->db->get('selfimpact_log');
return $query->results();
}
这是我的控制器
public function abt_article() {
$data= array();
$query = $this->abt_db->getlogrecords();
$data['logs']= $query;
$this->load->view('abt_article', $data);
}
风景
<table data-role="table" id="table-column-toggle" data-mode="columntoggle" class="ui-responsive table-stroke" data-inset="true">
<thead>
<tr>
<th data-priority="1">Statements</th>
<th data-priority="2">Try these positive affirmations</th>
</tr>
</thead>
<tbody>
<?php if(isset($logs)): foreach($logs as $row);?>
<tr>
<td><?php echo $row->log_id;?></td>
<td>I am ashamed and embarrassed that I have Postnatal Depression.</td>
</tr>
<tr>
<td><?php echo $row->logTime;?></td>
<td>What I am feelings are symptoms of illness. I am not making this up</td>
</tr>
<?php endforeach;?>
<?php else : ?>
<tr>
<td>No records found.</td>
</tr>
<?php endif;?>
</tbody>
</table>