Jump to content

Count of an Array


Mufleeh

Recommended Posts

Hi,

 

I need the count of the retrieved results from my data base. Below coding isn't working can anyone fix this to me?

 


$queryMe = $this->dbh->prepare("SELECT name_initials FROM view_teachers_information WHERE nic IN (SELECT nic FROM view_teachers_current_school_appointment WHERE appointment_category_name = 'Mathematics' AND census_id IN (SELECT census_id FROM view_schools WHERE division_id = '$div[division_id]'))");

				$queryMe->execute();
				$countMe = $queryMe->fetchall();

				$result = count($countMe);
				echo $result;


 

 

Regards,

Mufleeh

Link to comment
https://forums.phpfreaks.com/topic/241871-count-of-an-array/
Share on other sites

Did you call it through PDO (accessed using $this->dbh in your code), or through PDOStatement (accessed using $statement in your code)? Both have a method called errorInfo(), but since you're using a statement I believe the error will only be available in the statement object.

Link to comment
https://forums.phpfreaks.com/topic/241871-count-of-an-array/#findComment-1242296
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.