[symfony-users] Re: sql between statement

2009-03-05 Thread Gareth McCumskey
Not just that but it kind of breaks the whole database abstraction purpose behind using something like Propel. It opens the door to the developer using non-standard SQL which will break when you change database. On Thu, Mar 5, 2009 at 2:08 PM, Thomas Rabaix wrote: > be aware that Criteria::CUSTOM

[symfony-users] Re: sql between statement

2009-03-05 Thread Thomas Rabaix
be aware that Criteria::CUSTOM is a open door to SQL Injection. On Thu, Mar 5, 2009 at 12:57 PM, Kris Wallsmith < kris.wallsm...@symfony-project.com> wrote: > If you're using Propel, the following code should do the trick: > $criteria = new Criteria(); > $criteria-> > add(TransactionPeer::USER_

[symfony-users] Re: sql between statement

2009-03-05 Thread Kris Wallsmith
If you're using Propel, the following code should do the trick: $criteria = new Criteria(); $criteria-> add(TransactionPeer::USER_ID, 28)-> add(TransactionPeer::CREATED_AT, "created_at BETWEEN '3/2/2008 12:00:00 AM' AND '3/3/2009 11:59:59 PM'", Criteria::CUSTOM) ; $transactions = Transacti

[symfony-users] Re: sql between statement

2009-03-04 Thread Dheeraj Kumar Aggarwal
hi u should try this $c = new Criteria(); $date1 = '2008-02-03';//-mm-dd $date2 = '2008-03-03'; // test against date1 $date1Criterion = $c->getNewCriterion(TransactionsPeer::START_DATE, $date1, Criteria::LESS_EQUAL); // test against date2 $date2Criterion = $c->getNewCriterion(TransactionsP