I am trying to JSON_encode
data from a MySQL database. The characters in the DB are as should.
For example, some of the data contains this: è
When I print out to the browser, this is what I get for all items that have special characters:
{"category":null}
Here is the very basic watered down version of the code I am using to test:
$sql = mysql_query("SELECT category FROM master_cat ORDER BY category ASC");
while ($row = mysql_fetch_assoc($sql))
$output[] = $row;
print(json_encode($output));
How can I get actual data to appear in browser when I am reading the JSON on the web page and not null
?