<?
$host = "localhost";
$user = "root";
$pass = "1234";
$dbname = "student";
mysql_connect($host,$user,$pass) or die ("ติดต่อ host ไมได้");
mysql_select_db($dbname) or die ("ติดต่อฐานข้อมูลไม่ได้");
mysql_query("SET NAMES TIS620");
//Data From method GET
$extra_job_id=$_GET['extra_id'];
$std_id=$_GET['std_id'];
$del_state=$_GET['del'];
// For App...
$Sql = "Select * From std_extra_job Where ((extra_job_id='$extra_job_id') And (std_id='$std_id'))";
$Sql1=mysql_query($Sql);
// For Extra Jobs (Update Number of submit)
$Sql_Job = "Select * From extra_jobs Where id='$extra_job_id'";
$Sql_Job1=mysql_query($Sql_Job);
ส่วนนี้เป็นภาษา asp.net รบกวนช่วยแปลงเป็นภาษา php หน่อยนะค่ะ
Code (ASP)
if Not del_state then
eState=rs("state")
rs("state")=Not eState ' Update Field state
rs("backup_state") = Not rs("backup_state")
rs.Update
else
rs.Delete ' Delete Record
rs.Update
rsJob("num_submit")=rsJob("num_submit")-1 ' Reduce Number of Submit
rsJob("due_state")="False" ' Update Field state
rsJob.Update
?>