Closed matopeto closed 10 years ago
Well, you should use this
$source->where("DATE_FORMAT(`timestamp`, ?) = ?", '%Y-%m', $value);
it works with quotes only because it's column delimeter in postgre. This isses is tracked in #1112.
Ok, but maybe it should by denied and throwing an exception.
And how is correct way to escape strings in order? (Order method doesn't extra parameter to handles "?")
$source->order("FIELD(`state`, 'new', 'edited', 'deleted', 'public')")
is translated to:
ORDER BY FIELD(`state`, '`new`', '`edited`', '`deleted`', '`public`')
Of course, strings in double quotes works.
But I would like write someting like this:
$source->order('FIELD(`state`, ?, ?, ?, ?)', "new", "edited", "deleted", "public")
it should work...
$source->order('FIELD(`state`, ?, ?, ?, ?)', "new", "edited", "deleted", "public")
Ok thanks, I see, in 2.1 :) but in nette 2.0.x it is not :)
yes :)
is translated to:
(m is wrongly escaped)
But if I change quotes and double quotes:
output is correct
Both wheres should generate correct (2nd) expression.