<?php
include "../include/connect.php";
$db_conn = mysql_connect($host,$username,$password) or die ("ไม่สามารถติดต่อฐานข้อมูลได้");
mysql_select_db($dbname,$db_conn);
$sqln = "select * from tb_peo_pre where tea_id = '$tea_id' ";
$resultn = mysql_db_query ("$dbname", $sqln);
$n = mysql_num_rows ($resultn);
if ($n>0) {
$sql = "DELETE FROM tb_teacher_out WHERE tea_id = '$tea_id' ";
$rs = mysql_query($sql) or die ("ไม่สามารถเรียกข้อมูลได้");