$sqlfees = "SELECT feeid,occurence FROM feedetails WHERE applicablefor='$class'";
//fetching data
$fees_query = mysqli_query($db_conx, $sqlfees);
//executing query
$count = mysqli_num_rows($fees_query);
if($count > 0) {
while($fetch = mysqli_fetch_array($fees_query)) {
$feesarr[] = $fetch; //creating array
}
我想在$ feearr中添加一个名为' dates'以及带有一些价值的费用和出现
答案 0 :(得分:1)
尝试这样的事情
$sqlfees = "SELECT feeid,occurence FROM feedetails WHERE applicablefor='$class'";
//fetching data
$fees_query = mysqli_query($db_conx, $sqlfees);
//executing query
$count = mysqli_num_rows($fees_query);
if($count > 0) {
while($fetch = mysqli_fetch_array($fees_query)) {
$new_arr['date'] = $fetch['id'].'/'.other field what you want;
$feesarr[] = array_merge($fetch, $new_arr); //creating array
}