I'm trying to SELECT all rows as specified in the query below, but I think the issue is related to mysql_fetch_row, because in MYSQL Workbench the MYSQL query (yes I know I should be using PDO) shows all desired rows.
$result = mysql_query("SELECT zebra_id FROM zebra WHERE user_id = '$id' AND pref = '1'")
or die(mysql_error());
$array = mysql_fetch_row($result);
echo json_encode($array);
JSON Output (only showing 1 row):
["986"]
I tried changing to mysql_fetch_array, but that doesn't output all rows in the JSON encoded $array.