-
Notifications
You must be signed in to change notification settings - Fork 478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
not able to set OR condition for query. #216
Comments
you could use active record or_where();
|
@dadenewyyt , how to use or_where(); with get_by() or get_many() methods? Do I need to add new method for it? |
I guess u need to።modify the actual code።base on. MYmodel.php other wise ur
|
Can we use get_by() on email and if the returns null again make a get_by() on username? Is this technique costly and inefficient considering the database has huge number of rows? |
@gautamsawala, I think you can do that by executing two different QUERIES or by using or_where(). |
@vsogrimen do we have 'or_where()' as in built function in MY_Model? I cannot find it! |
You can use this form: $this->users->get_many_by("collumn1 = 1 OR collumn1 = 2 OR collumn1 = 3"); this works for me! |
Is it possible to set OR condition for any query?
I need to set condition for following query :
select * from users where username='abc' or email='[email protected]';
The text was updated successfully, but these errors were encountered: