I have the following PHP method that returns a JSON string from a MySQL query:
$sys_words_ref_join_query = mysql_query("
SELECT user_words.*, sys_words.*
FROM user_words, sys_words
WHERE user_words.sys_words_ref = sys_words.sys_words_ref
& user_words.user_info_ref = '1'
LIMIT 0, 7
");
$json_array = array();
while($words_obj = mysql_fetch_object($sys_words_ref_join_query)) {
$json_array[] = $words_obj;
}
$result = json_encode($json_array);
echo $result;
The problem I'm having is that the $result
is echoing only odd DB rows, eg. 1,3,5..., etc.
Any idea why? Thanks.