$MobileNo = $_POST['MobileNo'];
$query = "SELECT * FROM tblLotProcessStatus WHERE MobileNo = $MobileNo" ;
$result = sqlsrv_query($pdo,$query);
while ($row = sqlsrv_fetch_array($result,(SQLSRV_FETCH_ASSOC)))
{
if($row)
{
$status=array();
array_push($status,$row);
$response["status"] = $status;
$response["responce_code"] = 200;
$response["error_code"] = 0;
$response["error_msg"] = "status avialable";
echo json_encode($response);
}
JSON输出:
{
"error": false,
"status": [
{
"id": 1,
"strPartyCode": "00000000",
"intLotID": "257949",
"MobileNo": "9879105144 ",
"Messages": "Lot No : 15023 on Loop Ager/Poly started.,Style:PIGMENT PRINT",
"status": 0,
"Type": "PF ",
"dtmDateTime": {
"date": "2016-02-22 12:00:00.000000",
"timezone_type": 3,
"timezone": "Europe/Berlin"
},
"strLotNo": "N 15023",
"strProcess": "Loop Ager/Poly,Style:PIGMENT PRINT",
"strStatus": " started."
}
],
"responce_code": 200,
"error_code": 0,
"error_msg": "status avialable"
}{
"error": false,
"status": [
{
"id": 2,
"strPartyCode": "00000000",
"intLotID": "246654",
"MobileNo": "9879105144 ",
"Messages": "Lot No : 8191 on Compacting complited.,Style:DYED",
"status": 0,
"Type": "PF ",
"dtmDateTime": {
"date": "2015-03-09 15:00:00.000000",
"timezone_type": 3,
"timezone": "Europe/Berlin"
},
"strLotNo": "N 8191",
"strProcess": "Compacting,Style:DYED",
"strStatus": " complited."
}
],
"responce_code": 200,
"error_code": 0,
"error_msg": "status avialable"
}