Take care if the value come from the user request, you should add
(int)$month to avoid SQL Injection.

Thomas

On Wed, Aug 20, 2008 at 11:34 AM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
> You can use Criteria's custom parameter like so:
>
> $c = new Criteria();
> $c->add(RecordPeer::DATE, "MONTH(" . RecoredPeer::DATE .") = '".
> $month ."'", Criteria::CUSTOM);
>
> Regards,
>
> Jamie Learmonth
> Boxlight Media Ltd.
>
> On 20 Ago, 00:47, Hoaxz <[EMAIL PROTECTED]> wrote:
>> BTW I;ll like to get a Propel wise solution...
>>
>> On Aug 19, 3:45 pm, Hoaxz <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>> > Hey every one.
>>
>> > My problem is simple to understand but I can't find an answerd. I want
>> > to filter records by month, meaning that if in my APP the user ask for
>> > record with Month 01 (January), the search will return exaclty those
>> > records, but I can't find a way to compare the month on a DATE field
>> > with the month given.
>>
>> > PseudoCode would be something like
>>
>> > SELECT * FROM record WHERE MONTH(record.date) = $month
>>
>> > Any help or orientation may help.
>>
>> > Thanks
> >
>



-- 
Thomas Rabaix
Internet Consultant

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to