 |
|
อยากเก็บข้อมูลเข้าสองตารางครับ โดยจะเก็บข้อมูลเช่นค่า A ลงตารางหนึ่ง แล้วจะให้เก็บอีกหนึ่งตารางครับ โดยที่ต้องค่านั้น(ค่าA)ที่เพิ่งเก็บลงไป เอามาโชว์ในฟอร์มที่ 2 ด้วยครับโดยที่ไม่ต้องกรอกค่า A ลงไปใหม่นะครับ ขอบคุณครับจนปัญญาแล้วจริงๆ ครับ
รบกวนช่วยเช็คโค้ดให้ทีครับ มันไม่เก็บลงตารางเลยครับ อีกอันเขียนคล้ายกันเก็บเข้าอีกตารางได้ครับ
Code (PHP)
<?
$cid=$_GET['cid'];
$type = $_POST['type'];
$kind = $_POST['kind'];
$own=$_POST['own'];
$rent=$_POST['rent'];
$a=$_POST['a'];
$b=$_POST['b'];
$c=$_POST['c'];
$type1 = $_POST['type1'];
$kind1 = $_POST['kind1'];
$own1=$_POST['own1'];
$rent1=$_POST['rent1'];
$a1=$_POST['a1'];
$b1=$_POST['b1'];
$c1=$_POST['c1'];
$type2 = $_POST['type2'];
$kind2 = $_POST['kind2'];
$own2=$_POST['own2'];
$rent2=$_POST['rent2'];
$a2=$_POST['a2'];
$b2=$_POST['b2'];
$c2=$_POST['c2'];
$total1=$_POST['total1'];
$total2=$_POST['total2'];
$total3=$_POST['total3'];
include "connect.php";
$sql = "insert into agri1
(cid,type,kind,own,rent,a,b,c,type1,kind1,own1,rent1,a1,b1,c1,type2,kind2,own2,own2,a2,b2,c2,total1,total2,total3)
values('$cid','$type','$kind','$own','$rent','$a','$b','$c','$type1','$kind1','$own1','$rent1','$a1','$b1','$c1','$type2','$kind2','$own2'
,'$rent2','$a2','$b2','$c2','$total1','$total2','$total3')";
$dbquery = mysql_db_query($dbname, $sql);
mysql_close();
echo "<a href='show.php?'>ระบบได้ทำการบันทึกข้อมูลแล้ว</a>";
?>
Tag : PHP, MySQL, JavaScript, Ajax
|
|
 |
 |
 |
 |
Date :
2011-06-25 20:20:27 |
By :
salieaf |
View :
743 |
Reply :
3 |
|
 |
 |
 |
 |
|
|
|
 |