<?php include("connectdb.php"); $sql="INSERT INTO `stu` (`id` ,`name` ,`surname`)VALUES ('NULL', '$name', '$surname')"; mysql_query($sql); mysql_close($con); ?> <script language="javascript"> alert("บันทึกข้อมูลเรียบร้อยแล้ว") window.location.href="insert.php" </script>