Welcome Guest, Not a member yet? Register   Sign In
Database Helper - Between clause
#4

[eluser]The Revel[/eluser]
[quote author="CroNiX" date="1336707191"]There is much that isn't in AR. It could also be that other databases that CI supports doesn't have equivalent commands.
For those I just use a regular where.
Code:
->where("field BETWEEN '2012-04-01' AND '2012-05-01'")
Which is about the same amount of text
as
Code:
->where(field)->between('2012-04-01', '2012-05-01')
[/quote]

Thanks for the help, worked like a charm, minus some spelling errors on my part, but worked none the less. Thank you again.

ALso the reason I think that ->between() should be added is because its a pain in the but to type in what I did:

Code:
->where('date BETWEEN "' . $date1 . '" AND "' . $date2 .'"')

would have been nicer and LESS typing is there was a
Code:
->between($date1, $date2)
Or even a
Code:
->where('date', between($date1, $date2))
It would be more efficient IMHO.


Messages In This Thread
Database Helper - Between clause - by El Forum - 05-10-2012, 07:07 PM
Database Helper - Between clause - by El Forum - 05-10-2012, 08:33 PM
Database Helper - Between clause - by El Forum - 05-10-2012, 08:38 PM
Database Helper - Between clause - by El Forum - 05-10-2012, 10:14 PM
Database Helper - Between clause - by El Forum - 05-11-2012, 03:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB