简体   繁体   中英

How to Display Result of Query in codeigniter

I'm New Of codeigniter. I have trying to displaying output. It is not showing for written query. I have fetching some data from database. After fetch the, I try to show/echo data, but it's not show.

This is my code:

$iddss = $params['id'];
//print_r($iddss);
$cridit = $this->db->select('id, credit, firstName, lastName, email')
                   ->where('id', $iddss)
                   ->where('archived is NULL')
                   ->get('users')
                   ->row_array();
echo $cridit;  die;  

row_array() returns a single result row (as an array). If your query has more than one row, it returns only the first row.

So

echo $cridit['credit'];// will print the value of credit column in the first row matching the where clause

Read more about Codeigniter Query Results here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM