|
|
|
ช่วยดูโค๊ดจะเอาข้อมูลลงฐานข้อมูลไม่ได้อะครับ มีพวก Checkbox ด้วยครับ ช่วยที |
|
|
|
|
|
|
|
Code (PHP)
<!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>Untitled Document</title>
</head>
<body>
<?php
$Name_school=$_POST['Name_School'];//ตั้งค่าตัวแปล
$Number1=$_POST['Number1'];
$Moo=$_POST['Moo'];
$Road=$_POST['Road'];
$Dis=$_POST['Dis'];
$Canton=$_POST['Canton'];
$Province=$_POST['Province'];
$informant=$_POST['informant'];
$Phone=$_POST['Phone'];
$EMail=$_POST['EMail'];
$service=$_POST['service'];
$detail_service=$_POST['detail_service'];
$use=$_POST['use'];
$timelan=$_POST['timelan'];
$cou=$_POST['cou'];
$Detail=$_POST['Detail'];
?>
<?php
$objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database");
$objDB = mysql_select_db("db_nednet");
mysql_query("SET NAMES UTF8");
$strSQL = "INSERT INTO tbl_nednet (Name_school,Number,Moo,Road,Dis,Canton,Province,informant,Phone,E_Mail,service,detail_service,use,timelan,cou,detail)";
$strSQL .= "VALUES ";
$strSQL .= "('".$Name_school."','".$Number1."','".$Moo."','".$Road."','".$Dis."', '".$Canton."','".$Province."','".$informant."','".$Phone."','".$EMail."','".$service."','".$detail_service."','".$use."','".$timelan."','".$cou."','".$Detail."')";
$objQuery = mysql_query($strSQL);
echo $strSQL;
echo mysql_error();
mysql_close();
?>
</body>
</html>
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2013-07-06 21:59:04 |
By :
กิตคุง |
View :
669 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
$objQuery = mysql_query($strSQL) or die(mysql_error());
ดู Error หน่อยครับ
|
|
|
|
|
Date :
2013-07-06 22:37:44 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$objQuery = mysql_query($strSQL,$objConnect);
ลองเพิ่มนี่ได้ไหมครับ
|
|
|
|
|
Date :
2013-07-06 22:40:24 |
By :
champkung226 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|