|
|
|
แก้อย่างไรกับ Warning: array_push() expects parameter 1 to be array, string given in |
|
|
|
|
|
|
|
Warning: array_push() expects parameter 1 to be array, string given in แก้ไขอย่างไรครับ
โค้ดที่เขียน
if($result) {
while($row = mysqli_fetch_array($result,MYSQLI_ASSOC)) {
$seq += 1;
if($seq == 1) {
$scores = array(
"Score_".$seq."_1_1"=>$row["Score_1_1"],
"Score_".$seq."_1_2"=>$row["Score_1_2"],
"Score_".$seq."_2_1"=>$row["Score_2_1"],
"Score_".$seq."_2_2"=>$row["Score_2_2"],
"Score_".$seq."_2_3"=>$row["Score_2_3"],
"Score_".$seq."_2_4"=>$row["Score_2_4"],
"Score_".$seq."_2_5"=>$row["Score_2_5"],
"Score_".$seq."_2_6"=>$row["Score_2_6"],
"Score_".$seq."_2_7"=>$row["Score_2_7"],
"Score_".$seq."_2_8"=>$row["Score_2_8"],
"Score_".$seq."_2_9"=>$row["Score_2_9"],
"Score_".$seq."_2_10"=>$row["Score_2_10"],
"Score_".$seq."_2_11"=>$row["Score_2_11"],
"Score_".$seq."_2_12"=>$row["Score_2_12"]
);
} else {
array_push(
$scores["Score_".$seq."_1_1"]=$row["Score_1_1"],
$scores["Score_".$seq."_1_2"]=$row["Score_1_2"],
$scores["Score_".$seq."_2_1"]=$row["Score_2_1"],
$scores["Score_".$seq."_2_2"]=$row["Score_2_2"],
$scores["Score_".$seq."_2_3"]=$row["Score_2_3"],
$scores["Score_".$seq."_2_4"]=$row["Score_2_4"],
$scores["Score_".$seq."_2_5"]=$row["Score_2_5"],
$scores["Score_".$seq."_2_6"]=$row["Score_2_6"],
$scores["Score_".$seq."_2_7"]=$row["Score_2_7"],
$scores["Score_".$seq."_2_8"]=$row["Score_2_8"],
$scores["Score_".$seq."_2_9"]=$row["Score_2_9"],
$scores["Score_".$seq."_2_10"]=$row["Score_2_10"],
$scores["Score_".$seq."_2_11"]=$row["Score_2_11"],
$scores["Score_".$seq."_2_12"]=$row["Score_2_12"]
);
}
$summary_per = $row["Summary_percent"];
$grade = $row["Grade"];
}
Tag : PHP
|
|
|
|
|
|
Date :
2018-09-25 23:43:04 |
By :
iolitemos |
View :
1926 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เปิด document php อ่านเลยครับ ไม่ได้ยากเลย
|
|
|
|
|
Date :
2018-09-26 07:16:04 |
By :
Chaidhanan |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|