I have this content of my MySQL database column:
+-------+
|Status |
+-------+
| | // empty
| | // empty
|Reject |
|reject |
+-------+
I have some condition for this Status
, so the user can see the judgement of this case:
- If result
Reject
(automatically if select item) orreject
(some users type this after edit data ) echo Reject - If result
empty
or 'Accept' or 'accept` echo Accept
I have try this :
if($row['Status'] == "Reject"){
echo "Reject";
}
elseif($row['Status'] == "reject"){
echo "Reject";
}
else{
echo "Accept";
}
But, it's always echoing Accept
. Cause the result of the query below is empty
:
SELECT COUNT(Serial_number) AS n, SUM(S) AS S,SUM(A) AS A, SUM(B) AS B, SUM(C) AS C,
ROUND((((SUM(S)*1)+(SUM(A)*1)+(SUM(B)*0.4)+(SUM(C)*0.1))/COUNT(Serial_number)*1000000),0) AS PPM,
Status
FROM inspection_report WHERE Model LIKE 'MDV-Z700D' AND Lot_no LIKE '010A'
AND Line LIKE 'FA 21' AND Range_sampling ='177X0001-177X0100' GROUP BY Range_sampling
Result :
n S A B C PPM Status
20 0 1 0 0 50000 //this empty status make echo = Accept
If using GROUP_CONCAT(Status)
result is ,,Reject,reject
.So, how to echo each condition refer to 2 case above ?
Note : I want if inside that column have reject value the result echo reject even I have a lot of accept value.