0
votes

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: http://i.stack.imgur.com/dn85M.png

1
It looks like where is a keyword in Eloquent, so maybe change the function name to just email_and_passwordTim Withers
@TimWithers does not work :(user2970561

1 Answers

0
votes

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.