File manager - Edit - /var/www/ams.cmtc.ac.th/clear-regis_student_log.php
Back
<?php require("inc/config.inc.php"); require("inc/common.php"); //error_reporting(~E_NOTICE); error_reporting(E_ALL & ~E_WARNING & ~E_NOTICE); ?> <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> เคลียร์ tb:regis_student_log ข้อมูลเข้าระบบซ้ำกัน<br> <?php global $connect; //ประวัติการเข้าระบบ $sql_regis_student_log="Select * From regis_student_log where academicYear='$academicYear' AND semester='$semester' order by studentCode ASC"; $db_query_regis_student_log=mysqli_query($connect,$sql_regis_student_log); $num_rows_regis_student_log=mysqli_num_rows($db_query_regis_student_log); /* นับ Reccord ที่พบ */ $a=0; $studentCode_old=""; echo "num_rows_regis_student_log=$num_rows_regis_student_log<br>"; while($a < $num_rows_regis_student_log) { $result = mysqli_fetch_array($db_query_regis_student_log); $id2=$result['id']; $studentCode=$result['studentCode']; //เช็คข้อมูลว่า กำลังศึกษาอยู่ หรือเปล่า $num_result=num_record("std2018_student","where studentCode='$studentCode' AND studentStatusCode='03' "); //echo $num_result; echo "$id2 $studentCode $num_result "; //ตรวจสอบว่าข้อมูลซ้ำหรือเปล่า if($studentCode_old!=$studentCode){ if($num_result==0){ //นักศึกษา พ้นสภาพ ลบข้อมูลทิ้ง delete("regis_student_log","where id='$id2'"); echo "<< del พ้นสภาพ"; } }else{ //กรณีเด็กซ้ำให้ลบออกข้อมูลที่ซ้ำออก delete("regis_student_log","where id='$id2'"); echo "<< del ซ้ำ"; } echo"<br>"; $studentCode_old=$studentCode; $a++; } ?> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.41 |
proxy
|
phpinfo
|
Settings