0) { $data = array(); while ($rows = mysqli_fetch_assoc($result)) { $oderid = $rows["oderid"]; $name = $rows['name']; $odersta = $rows['oder_sta']; $type = $rows['type']; $price = $rows['price']; $state = $rows['state']; $notes = $rows['beizhu']; $crtime = date('Y-m-d H:i:s', $rows['cr_time']); $dztime = date('Y-m-d H:i:s', $rows['dz_time']); $data[] = array( "account" => $rows['account'], "oderid" => $oderid, "name" => $name, "odersta" => $odersta, "type" => $type, "price" => $price, "status" => $state, "notes" => $notes, "crtime" => $crtime, "dztime" => $dztime, ); } echo json_encode($data); } else { echo json_encode(array("error" => "没有符合条件的数据")); }