I’m retreiving score & course_code from my table, so that all the courses that have a score less than 40 should be copied into an array $carry_over.
var_dump($carry_over) only gives "Array" when i run the script.
Please how can i put/get the course_code of those courses that have a score of <40?
Thanks for the help. I most appreciate it.
$carry_over = array();
while ($row8 = mysql_fetch_assoc ($query8)) {
if ($row8['score'] < 40) {
$carry_over = array( 'm.course_code' => $row8['m.course_code']) ;
}
}
var_dump($carry_over);
Query8
$query8 = mysql_query("SELECT m. score , m.course_code
FROM maintable AS m
INNER JOIN students AS s ON
m.matric_no = s.matric_no
INNER JOIN courses AS c ON
m.course_code = c.course_code
WHERE m.matric_no = '".$matric_no."'
AND m.level = '".$level."'")
or die (mysql_error());
Try below :