I tried extensively to find an answer but my question seems to be too specific.
My query contains latin characters:
$mydb->query("SELECT cotação FROM compras");
It's working fine when called in a WordPress shortcode, but in a custom php on the same site it gives me this:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '??o FROM compras' at line 1
Now, I don't want to just remove the characters because I know the query works and I'd rather understand the problem.
So what's going on here? Thanks.