<?php require_once("../../db.php"); ?>
<?php try {
	
		$core = Core::getInstance();
		$stmt = $core->dbh->prepare("SELECT count(*) as sum FROM messages where mess_client_id = :mess_client_id");
		$stmt -> bindParam("mess_client_id", $_GET["client_id"], PDO::PARAM_INT);
		
		
		$stmt -> execute();
		$results = $stmt -> fetchAll(PDO::FETCH_ASSOC);
		
		echo $results[0]["sum"];
		
	
		//echo $results["sum"];
		
	} catch(PDOException $pe) {
		
		trigger_error('Could not connect to MySQL database. ' . $pe->getMessage() , E_USER_ERROR);
		
	}
?>