[eluser]ludo31[/eluser]
[quote author="Rolly1971" date="1330268600"]why not use CI Active Record:
Code:
public function getRow($genre)
{
$this->db->select('identifiant_genre');
$this->db->from('gnr_convenir')';
$this->db-where('identifiant_genre', $genre);
$query = $this->db->get();
return $query;
}
[/quote]
but here
Code:
[b] $config['total_rows']= $this->client_model->getRow(1);[/b]
$query here return an object as array not the number of line
so I would like to know the number of line of the result of your query so if we make
Code:
$data['result'] = $this->client_model->getRow(1);
$config['total_rows']= $data.????num_rows????
probably we must choose sizeof($array) to know the number
[code]
$query['result'] = $this->client_model->getRow(1);
$nombre_ligne = sizeof($query);
echo $nombre_ligne;
var_dump($query);exit;
array
'result' =>
object(CI_DB_mysql_driver)[13]
public 'dbdriver' => string 'mysql' (length=5)
public '_escape_char' => string '`' (length=1)
public '_like_escape_str' => string '' (length=0)
public '_like_escape_chr' => string '' (length=0)
public 'delete_hack' => boolean true
public '_count_string' => string 'SELECT COUNT(*) AS ' (length=19)
public '_random_keyword' => string ' RAND()' (length=7)
public 'use_set_names' => boolean false
public 'ar_select' =>
array
[/code]
I think it's an error because there are a lot of rows in phpAdmin when I see it