Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

242
Vistas
Select count int type

I have this select where I want to get id count:

$x = DB::select('   select count(id)
                    from repairs
                    where vehicle_id = ?',
                    [$vehicle->id]);

But I am not sure if I am getting in my variable $x just a simple int number or some string type, because I want to use this $x variable in

if($x>0){ 
   do something
}

And I always get non zero value, even though I should get zero. What is wrong?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

i think your select not returning a scale value. and because i don't know your ORM i just can tell you try if(count($x)>0)

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda