jeudi 17 novembre 2016

Laravel 5.2 How to use && and || in if statements

I dont know why my code is not working.

if(($TotalHrs_final <= 0) && ($m <= 0))
  {
             DB::table('users')->where('id', $nerd->user_id)->update(['check' => '0']);
  }

its not doing the

if(($TotalHrs_final <= 0) && ($m <= 0))

part but when i just do

if($TotalHrs_final <= 0) 

the code is working. Am I using the "&&" wrong, is this the right way on doing it? Can someone help me with this.

Aucun commentaire:

Enregistrer un commentaire