Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

243
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!