Please help needed php functions difficult

Please I need your help with my project code.
I was using this custom code to return the student result grading view before I change.
But my problem now is that I want to fetch everything from the database
both the courses and semester result

Here the old code I was using before
` <?php

	//custom function check credit hour and grade point
	function credit_hour($x){
		if($x=="DBMS") return 3;
		elseif($x == "DBMS Lab") return 1;
		elseif($x == "Mathematics") return 4;
		elseif($x == "Programming") return 3;
		elseif($x == "Programming Lab") return 1;
		elseif($x == "English") return 4;
		elseif($x == "Physics") return 3;
		elseif($x == "Chemistry") return 3;
		elseif($x == "Psychology") return 3;
	}
	function grade_point($gd){
		if($gd<39) return 0;
		elseif($gd>=40 && $gd<44) return 1;
		elseif($gd>=45 && $gd<49) return 1;
		elseif($gd>=50 && $gd<59) return 2;
		elseif($gd>=60 && $gd<=69) return 3;
		elseif($gd>=70 && $gd<=100) return 4;
	}
	?>`

And the new code that I want to use, am getting errors
<?php

$stud_regno=$_GET[‘regno’];

if (isset($stud_regno)){

mysqli_select_db( $conn, $database_conn);
$query_students = “SELECT * FROM students WHERE reg_no=’$stud_regno’”;
$students = mysqli_query( $conn, $query_students) or die(mysqli_error($GLOBALS["___mysqli_ston"]));
$row_students = mysqli_fetch_assoc($students);
$totalRows_students = mysqli_num_rows($students);

mysqli_select_db( $conn, $database_conn);
$query_result = “SELECT * FROM first_semester WHERE reg_no=’$stud_regno’”;
$result = mysqli_query( $conn, $query_result) or die(mysqli_error($GLOBALS["___mysqli_ston"]));
$row_result = mysqli_fetch_assoc($result);
$totalRows_result = mysqli_num_rows($result);

$cus=0;
$gps=0;
$sgpa=0;
}

?>

Hello and welcome to the forum :partying_face:!

What’s the problem? Is there any error?