الرئيسية / صفحات / النتيجة

النتيجة

[insert_php] $servername = “173.0.129.104”;
$username = “domo200_zaguser”;
$password = “zag2020user”;
$dbname = “domo200_zag”;

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die(“Connection failed: ” . $conn->connect_error);
}
mysqli_set_charset($conn ,”utf8″);

$sql = “SELECT ID , studentCode , CourseID , CourseCode , CourseName , CourseDegree , CourseDegree2 FROM midterm_results WHERE studentCode = “.trim($_POST[‘studentCode’]);
$rs = $conn->query($sql);
//$sql = “SELECT ID , studentCode , CourseID , CourseCode , CourseName , CourseDegree , CourseDegree2 FROM student_results WHERE studentCode = “.trim($_POST[‘studentCode’]);

if ($rs->num_rows > 0) {
$table = ‘‘;
$table .= ‘

‘;
$table .= ‘

‘;
$table .= ‘

‘;
$table .= ‘

‘;
$table .= ‘

‘;

$table .= ‘

‘;

while($row = $rs->fetch_assoc()) {

$table .= ‘

‘;

$table .= ‘

“;

if ($row[“CourseID”] == 15){
$table .= ‘

“;
$table .= ‘

“;}
else {
$table .= ‘

“;
$table .= ‘

“;
$table .= “

“;
}

}
} else {
echo “0 results”;
}
$conn->close();

$table .= “

كود المادة اسم المادة الدرجة

“;

echo $table;
[/insert_php]

اترك تعليقاً

لن يتم نشر عنوان بريدك الإلكتروني. الحقول الإلزامية مشار إليها بـ *