1

I got an error with this code and the error is just from 'verification'< 25 The "less than" operator is the issue when I change that with => it does not come up with an error. How do I rewrite this query?

$allRecords = DB::table('users')->select(DB::raw('CONCAT(name, " ", last_name) AS name'),'email as email_address')->where(array('verification'< 25,'is_admin'=>0,'is_approved'=>1))->orderby('id', 'DESC')->get();
8
  • try this 'verification<' and let me know please? Commented Jun 26, 2020 at 2:15
  • You mean 'verification<' => 25 or just 'verification<' 25? Commented Jun 26, 2020 at 2:17
  • just 'verification<' 25 Commented Jun 26, 2020 at 2:18
  • Still getting errors Commented Jun 26, 2020 at 2:23
  • The error is coming from PHP or MySQL? Commented Jun 26, 2020 at 2:29

1 Answer 1

1

Try like below

$allRecords = DB::table('users')
                 ->select(DB::raw('CONCAT(name, " ", last_name) AS name'),'email as email_address')
                 ->where('verification', '<', 25)
                 ->where(array('is_admin'=>0,'is_approved'=>1))
                 ->orderby('id', 'DESC')
                 ->get();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.