user2970561
user2970561

Reputation: 1

Laravel where_column1_and_column2 error?

I use laravel 4 PHP Framework when I write this method:

where_email_and_password($email, $password)

show this error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column '_email_and_password' in 'where clause' (SQL: select * from users where _email_and_password = ? limit 1) (Bindings: array ( 0 => '[email protected]', ))

See code and error: https://i.sstatic.net/dn85M.png

Upvotes: 0

Views: 43

Answers (1)

William Cahill-Manley
William Cahill-Manley

Reputation: 2405

Looks like you are migrating from Laravel 3 where this is a valid method call. In Laravel 4, everything follows the camel case convention. I have not tested this but looking at the source code for the method that handles dynamic wheres, try whereEmailAndPassword($email, $password)

See the method here: https://github.com/laravel/framework/blob/master/src/Illuminate/Database/Query/Builder.php#L747

Hope this helps.

Upvotes: 0

Related Questions