this works on phpmyadmin , but gives me and error when I am using on the code, the error says ,Parse error: syntax error, unexpected \'%\'....
whats wrong with my sintax
It's because your string is terminated by single quotes $database->setQuery('
- just change to double quotes and it will work.
$database->setQuery(" ");
You have to escape the ' mark. So instead of
DATE_FORMAT(quizSession.finished_on,'%M %d, %Y')
try
DATE_FORMAT(quizSession.finished_on,\'%M %d, %Y\')
Or you can just use double quotes " to start and end the string.