How to return an integer value for the Rows in the codeiginter?

Asked

Viewed 47 times

2

How do I return an integer value for the rows returned in select?

$query = $this->db->where("categoria_titulo", $categoria);
$query = $this->db->get("categorias");
$query = $query->num_rows();
echo $query;
  • I posted an answer, try it that way, anything let me know... I use a lot of codeigniter. If you want to add me in Skype to change some stickers, write down: srandrebaill - Att

1 answer

1


Set a variable for the record number search:

                $query = $this->db->where("categoria_titulo", $categoria);
                $query = $this->db->get("categorias");
                $query_num = $query->num_rows();
                echo $query_num;

Or else do

                $query = $this->db->where("categoria_titulo", $categoria);
                $query = $this->db->get("categorias");
                return $query->num_rows();

Browser other questions tagged

You are not signed in. Login or sign up in order to post.