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('
$database->setQuery(" ");