|
 |
|
php + mysql บันทึกข้อมูลวันที่ไม่เข้าในฐานข้อมูลช่วยแนะนำหน่อย |
|
 |
|
|
 |
 |
|
บันทึกข้อมูลวันที่ไม่เข้าในฐานข้อมูลช่วยแนะนำหน่อย รายการอื่น ๆเข้าปกติ เซ็คแล้วหายไม่เจอ
หน้า save
Code (PHP)
<?
include("inc/connect.php");
$mi_start = $_POST['mi_start'];
$mi_end = $_POST['mi_end'];
$oil_date = $_POST['oil_date'];
$amt_oil = $_POST['amt_oil'];
$lpg_date = $_POST['lpg_date'];
$amt_lpg = $_POST['amt_lpg'];
$note = $_POST['note'];
echo "$mi_start<br>$mi_end<br>$oil_date<br>$amt_oil<br>$lpg_date<br>$amt_lpg<br>$note<br>";
$sql= "insert into tb_car
values('','$mi_start','$mi_end','$oil_date','$amt_oil','$lpg_date','$amt_lpg','$note')";
mysql_query($sql) or die("error=$sql <hr>".mysql_error());
echo "<script>window.location='index.php';</script>";
//print_r ($sql);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>บันทึกข้อมูล</title>
</head>
<body>
</body>
</html>
หน้า add
Code (PHP)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>[add data]</title>
<link rel="stylesheet" href="pagestyle.css" media="screen, projection" />
<link rel="stylesheet" href="slimpicker.css" media="screen, projection" />
<script src="mootools-1.2.4-core-yc.js"></script>
<script src="mootools-1.2.4.4-more-yc.js"></script>
<script src="slimpicker.js"></script>
</head>
<body>
<form action="sr_save.php" method="post">
<table width="454" height="437" border="1">
<tbody><tr>
<th colspan="2" scope="row" bgcolor="#33FFFF">การบันทึกข้อมูลรถ</th>
</tr>
<tr>
<th width="140" scope="row">เลขที่ไมล์เริ่มต้น</th>
<td><input type="text" name="mi_start" id="mi_start"></td>
</tr>
<tr>
<th scope="row">เลขที่ไมล์สิ้นสุด</th>
<td><input type="text" name="mi_end" id="mi_end"></td>
</tr>
<tr>
<th scope="row">วันที่เติมน้ำมัน</th>
<td >
<input name="oil_date" id="oil_date" type="text" class="slimpicker" />
</tr>
<tr>
<th scope="row">ยอดเงิน</th>
<td><input type="text" name="amt_oil" id="amt_oil">บาท</td>
</tr>
<tr>
<th scope="row">วันที่เติมแก๊ส</th>
<td><input name="lpg_date" id="lpg_date" type="text" class="slimpicker" /></td>
</tr>
<tr>
<th scope="row">ยอดเงิน</th>
<td><input type="text" name="amt_lpg" id="amt_lpg">บาท</td>
</tr>
<tr>
<th height="137" scope="row">หมายเหตุ</th>
<td><textarea name="note" id="note" cols="30" rows="5"></textarea></td>
</tr>
<tr>
<th height="28" colspan="2" scope="row"><input type="submit" name="button" id="button" value="Submit"></th>
</tr>
</tbody></table>
</form>
<script>
$$('input.slimpicker').each( function(el){
var picker = new SlimPicker(el);
});
</script>
</body>
</html>
Tag : PHP, Ms Access, MySQL, Ms SQL Server 2005, HTML/CSS

|
|
 |
 |
 |
 |
Date :
2013-08-02 18:55:54 |
By :
mrcool_307 |
View :
642 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
$sql echo ออกมาแล้วได้แบบไหนคับ
|
 |
 |
 |
 |
Date :
2013-08-03 04:42:49 |
By :
Krungsri |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|