Comments (7)
You can use this form:
$this->users->get_many_by("collumn1 = 1 OR collumn1 = 2 OR collumn1 = 3");
this works for me!
from codeigniter-base-model.
you could use active record or_where();
On Jan 6, 2016 5:02 PM, "tejashsoni111" [email protected] wrote:
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='abc@defcom';—
Reply to this email directly or view it on GitHub
#216.
from codeigniter-base-model.
@dadenewyyt , how to use or_where(); with get_by() or get_many() methods? Do I need to add new method for it?
from codeigniter-base-model.
I guess u need to።modify the actual code።base on. MYmodel.php other wise ur
have the option to define a method inside ur model like student_model.php a
function።purly apply codei።tired active record the or_where query please
sear h on that.
On Jan 7, 2016 8:06 AM, "tejashsoni111" [email protected] wrote:
@dadenewyyt https://github.com/dadenewyyt , how to use or_where(); with
get_by() or get_many() methods? Do I need to add new method for it?—
Reply to this email directly or view it on GitHub
#216 (comment)
.
from codeigniter-base-model.
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?
from codeigniter-base-model.
@gautamsawala, I think you can do that by executing two different QUERIES or by using or_where().
from codeigniter-base-model.
@vsogrimen do we have 'or_where()' as in built function in MY_Model? I cannot find it!
from codeigniter-base-model.
Related Issues (20)
- Clarification on Order By HOT 3
- Select specific fields HOT 4
- Get data from 2 tables joint in abother table HOT 7
- Custom "with()" method that has two joins, how to? HOT 8
- Observers not working HOT 2
- Validation not work HOT 1
- Call to a member function where() on null on Line: 895
- Three levels relationship HOT 5
- Multiple validation rules
- after_delete should also pass the original arguments
- Mandatory relationship HOT 1
- Validation and CI 3.0
- Temporarily disable soft delete? HOT 2
- Delete with where? HOT 1
- Where Dinamic Session
- How to relationship when id value has comma
- Order by Appending HOT 3
- $this->db->last_query() is always NULL HOT 1
- New maintainence HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from codeigniter-base-model.