<?=$this->db->count_all_results('users')?>
Hi, I am stuck on something. How can run a query like the below count and echo all of the returned rows? I am currently using the above statement but I need this improvement.
<?php $aa = $this->db->query("SELECT * FROM users WHERE itemNumber = 1");
Use num_rows() method
<?php
$aa = $this->db->query("SELECT * FROM users WHERE itemNumber = 1");
echo $aa->num_rows();
?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With