<?
$objConnect = mysql_connect("localhost","root","123456") or die("Error Connect to Database");
$objDB = mysql_select_db("test");
mysql_query("SET NAMES utf8");
$result=mysql_query("INSERT INTO service (number_repair,detail)
VALUES ('".$_POST['number_repair']."','".$_POST['detail']."')") or die (mysql_error());
?>
<a href="edit.php?id=<?=$objResult["id"];?>">คลิกเพื่อดูข้อมูล</a>
อันนี้คือการเรียกข้อมูลออกมา ซึ่งจะ ดึงมาจาก Table Test Code (PHP)
$objConnect = mysql_connect("localhost","root","123456") or die("Error Connect to Database");
$objDB = mysql_select_db("test");
mysql_query("SET NAMES utf8");
$strSQL = "SELECT * FROM test,service
WHERE test.number = service.number_repair";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
if(!$objResult)
{
echo "Not found FilesID=".$_GET["id"];
}
else
{
?>
$strSQL = "SELECT test.*,service.* FROM test,service
WHERE test.number = service.number_repair and service.number_repair =$_GET['number_repair']
and service.detail = $_GET['detail'] ";
//เพิ่มเงื่อนไขค่าที่กรอกมาด้วย
$strSQL = "SELECT test.*,service.* FROM test,service
WHERE test.number = service.number_repair and service.number_repair =$_GET['number_repair']
and service.detail = $_GET['detail'] ";