[development] Problem with DATE_FORMAT and Module

Jamie Holly hovercrafter at earthlink.net
Tue Nov 23 19:57:33 UTC 2010


%d is a placeholder for a decimal for Drupal's db_query. Change it to %%d.

Jamie Holly
http://www.intoxination.net
http://www.hollyit.net


On 11/23/2010 2:50 PM, Damian Adriel Perez Valdes wrote:
> Hello:
>
> I have a problem. I like to list the event for the actual day. This
> it's my sql query:
>
> SELECT *
> FROM {node}
> INNER JOIN {content_type_event} ON {node.vid}={content_type_event.vid}
> INNER JOIN {node_revisions} ON {node.vid}={node_revisions.vid}
> WHERE DATE_FORMAT( from_unixtime( content_type_event.field_fecha_value
> ) , "%d-%m-%Y" ) = "'.date("d-m-Y").'"
>
> If i test this sql query in phpmyadmin, this work fine, but, if i test
> this query in my drupal module this module don't work.
>
> But this work if i delete %d
>
> WHERE DATE_FORMAT( from_unixtime( content_type_event.field_fecha_value
> ) , "%d-%m-%Y" ) = "'.date("d-m-Y").'"
>
> What can i do for this ?
>


More information about the development mailing list