I did search for this but may be my search sucks. So posting it here..my code below
while( $row = mysqli_fetch_array($queryRecords) ) {
$data['data'][] = array(
'student_name' => $row['name'],
'totalmark' => $row['totalmark'],
$marksheet = calculatepercent(totalmark),
'resultdate' => $row['resultdate'].$marksheet,
'ID' => $row['ID']
);
Here I call function calculatepercent(totalmark) so that the function returns a value and store that in $marksheet. But my problem is this does not work i.e I cannot store the result of calculatepercent(totalmark) because I cannot access 'totalmark'
Forget performance for a minute but how do you make this work? (If you have tips for performance that's a bonus too! ) - Thanks Coders!
RR
totalmarka constant?