do-while で配列を作成しようとしています。
$result = mysql_query("SELECT * FROM data WHERE company='$companyID'", $db);
if (mysql_num_rows($result) > 0)
{
$resultData = mysql_fetch_array($result);
do
{
$json[] = array('product' => $resultData['product'], 'title' => $resultData['title']);
}
while($resultData = mysql_fetch_array($result));
echo json_encode($json);
}
終了時にすべてのデータが空です (エラー):
"[{"product":"","title":""},{"product":"","title":""},{"product":"","title":""},{"product":"","title":""}]"