Hello everyone, as you will see, I have the following query in cakephp
$query = $this->PreguntasAlternativas->find();
$query->select(['id_alternativa' => $query->func()->max('id_alternativa')
])->where(['id_pregunta' => $idquestion]);
this gives me an arrangement like that
query(array)
0(object)
id_alternativa(null)
and what I want is to get the value that returns to me and then make a validation with it is because I do not know how to recover the value that the query returns to me to do something like that
if($query == null){
$result = 1;
}else{
$result = $query->first()+1;
}
that I was intendo but does not go through the help if please, thank you !!!!!