Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

find and findFirst, with and w/out parameters, always returning empty

Hi there. I have a pretty shitty error and I can't get a query working.

I have this simple lines:

$trivia = KptTrivias::findFirst('id_kpt_events="10"');
if ($trivia) {
    $this->view->trivia = $trivia;
} else {
    $this->view->trivia = 'NO_DATA_FOUND';
}

and then in the volt file I have:

<?php echo json_encode($trivia, JSON_PRETTY_PRINT); ?>

And well, nothing comes out. My database has just one registry: Registro

How is that even possible?



4.3k
Accepted
answer
edited Jul '14

BTW, I already realized what was going on, it was a matter of collation. I made manual insertions in database, and the collation was UTF-8. removing the special character was all good.