How to Display Result of Query in codeigniter

Jay Prakash :

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;  
invalid bot :

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.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=171062&siteId=1