[eluser]xwero[/eluser]
[quote author="andregufc" date="1187767333"]it is possible?
$query = $this->db->getwhere('comments', array('news_id'=>'1'));
$query = $this->db->getwhere('comments', array('titulo'=>'teste'));
$query = $this->db->getwhere('comments', array('post'=>'teste'));
$query = $this->db->getwhere('comments', array('author'=>'andre'));
$num_rows = $query->num_rows();[/quote]
If you want to get te number of rows with those values you can do
Code:
$query = $this->db->getwhere('comments', array('news_id'=>'1','titulo'=>'teste','post'=>'teste','author'=>'andre'));
$num_rows = $query->num_rows();
which gives following sql
SELECT * FROM comments WHERE news_id= 1 AND titulo = 'teste' AND post = 'teste' AND author = 'andre'