I'm trying to execute the following :
db_query('SELECT FROM_UNIXTIME(`created`, "%Y") as year, FROM_UNIXTIME(`created`, "%m") as month, FROM_UNIXTIME(`created`, "%d") as day FROM users ORDER BY `created`');
And because of the % sign the result is : PDOException : SQLSTATE[42S22]: Column not found: 1054 Unknown column '%Y' in 'field list'
I tried escaping the % with a double %% resulting in : PDOException : SQLSTATE[42S22]: Column not found: 1054 Unknown column '%%Y' in 'field list'
Of course this query works in phpmyadmin
Help ?