I have a dilemma when printing a variable, you see, this is my query in SQL:
SELECT MONTH(fecha_del_deposito) AS mes, SUM(importe) as monto FROM pago_cliente
And it throws the following:
Which happens to query in php:
'cantidadPagos' => $this->Backend_model->rowCountPagos("pago_cliente"),
public function rowCountPagos($tabla)
{
$this->db->select("MONTH(fecha_del_deposito) as mes, SUM(importe) as monto");
$this->db->from($tabla);
$resultados = $this->db->get();
return $resultados->result();
}
If I print it with print_r
it results in this:
Array ( [0] => stdClass Object ( [mes] => 3 [monto] => 3484 ) )
And I need to print only the value of "Amount" (in this case 3484) but I do not find the appropriate form, what I do so far is:
<?php echo $cantidadPagos[1]; ?>
I know it's completely wrong, but I do not know how to do it, I need help.
Thanks