I'm using Yii2 framework.
I'm trying to get the number of records of my table and if the result is smaller than X number, show this number of records.
When I run my script, the error is:
'Object of class app\models\BusquedaCotizacion could not be converted to string'
This is my code:
$query = BusquedaCotizacion::find()
->select('cotizacion')
->where('LIKE', cotizacion, 'BOB')
->all();
$bobresult = count($query);
if ($bobresult < 6) {
echo ("No se obtuvieron todas las consultas de Bolivia. De las 6 posibles, se obtuvieron $bobresult.");
}else{
echo ("Se obtuvieron todas las cotizaciones de Bolivia");
}
I would appreciate any kind of help.