justl00king
8 months ago
913
13
Laravel

Where query using and md5 value - lavavel 5.3

Posted 8 months ago by justl00king

I'm trying to query the database to get the record that matches the unique id for a user.

 User::whereRaw(('md5(unique_id)'), $mdid)->first();

This returns the first id in the database, not the intended user

 User::whereRaw(('md5(unique_id)'), $mdid)->get();

This returns every user in the database

Any suggestions, thank you!

Please sign in or create an account to participate in this conversation.