简体   繁体   中英

laravel controller not returning data but the condition in the where clause is true?

I am using laravel 9x. I made the condition where(email,'Auth::user()->email)->where('active',',=';3)->get();

there is a lot of data where active is not equal to 3 but still, it's not returning any data.

SQL doesn't use != .

Replace it with <> instead.

->where('active','<>',3)

Also where(email,'Auth::user()->email) should be:

where('email', Auth::user()->email)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM