1

Is there a way to use codeigniters active record system to construct a query that will search for rows that fall between two dates (rows has an added field and I want to supply the query a start and end date)?

I have checked the documentation knowing that mysql includes a between keywork for such things but can't see anything related to it.

Thanks in advance

1 Answer 1

2

You can just use two where() methods. They will be bound via AND, so if the first is 'everything after' and the second is 'everything before', you get a 'everything in between'.

If you want to use SQL goodies like NOW(), use where()s third parameter, and set it to False.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.