|
|
|
insertข้อมล ไม่ขึ้น แก้ปัญหามา สองวัน ยังหา ไม่เจอเลยคับ ช่วยหน่อยนะครับ |
|
|
|
|
|
|
|
Code (PHP)
<?php
include("config.inc.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>แก้ไขเรียบร้อย</title>
</head>
<body>
<?php
$addquery = mysql_query("SELECT * FROM site_details WHERE site_num ='".$_POST["txtn_num"]."'");
$rows_add = mysql_fetch_array($addquery);
if(!$rows_add){
$sql= "INSERT INTO site_details (
'site_id' ,
'site_name' ,
'site_sub' ,
'site_district' ,
'site_proince' ,
'site_latitude' ,
'site_logtitude' ,
'site_2g' ,
'site_3g' ,
'site_4g' ,
'site_ip3g' ,
'site_ip4g' ,
'site_trmpls' ,
'site_trptn' ,
'site_tratn' ,
'site_trmw ',
'site_trcx600' ,
'site_trdwdm' ,
'site_cb3g' ,
'site_cb4g' ,
'site_peamain' ,
'site_peasub' ,
'site_acmon' ,
'site_actue' ,
'site_acwed' ,
'site_acthu' ,
'site_acfri' ,
'site_acsat' ,
'site_acsun' ,
'site_acnote'
)
VALUES ('".$_POST['txt_id']."','".$_POST['txtname']."', '".$_POST['txtdistrict']."', '".$_POST['txtsub']."',
'".$_POST['txtproince']."' , '".$_POST['txtlatitude']."', '".$_POST['txtlogtitude']."',
'".$_POST['txt2g']."', '".$_POST['txt3g']."', '".$_POST['txt4g']."',
'".$_POST['txtip3g']."', '".$_POST['txtip4g']."', '".$_POST['trmpls']."',
'".$_POST['trptn']."', '".$_POST['tratn']."', '".$_POST['trmw']."', '".$_POST['trcx600']."',
'".$_POST['trdwdm']."', '".$_POST['cb3g']."', '".$_POST['cb4g']."', '".$_POST['peamain']."',
'".$_POST['peasub']."', '".$_POST['acmon']."', '".$_POST['actue']."', '".$_POST['acwed']."',
'".$_POST['acthu']."', '".$_POST['acfri']."', '".$_POST['acsat']."', '".$_POST['acsun']."', '".$_POST['acnote']."', )";
}else{
echo "เพิ่มไม่ได้";
}
echo $sql;
$dbquery = mysql_query($sql);
if($dbquery){
echo "สำเร็จ";
}
else{
echo "ไม่สำเร็จ";
}
mysql_close(); ?>
<td><div align="center"><a href="test.php">กลับไปค้นหาข้อมุลลูกค้า</a></div></td>
มันจะขึ้นว่า
INSERT INTO site_details ( 'site_id' , 'site_name' , 'site_sub' , 'site_district' , 'site_proince' , 'site_latitude' , 'site_logtitude' , 'site_2g' , 'site_3g' , 'site_4g' , 'site_ip3g' , 'site_ip4g' , 'site_trmpls' , 'site_trptn' , 'site_tratn' , 'site_trmw ', 'site_trcx600' , 'site_trdwdm' , 'site_cb3g' , 'site_cb4g' , 'site_peamain' , 'site_peasub' , 'site_acmon' , 'site_actue' , 'site_acwed' , 'site_acthu' , 'site_acfri' , 'site_acsat' , 'site_acsun' , 'site_acnote' ) VALUES ('123','', '', '', '' , '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', )ไม่สำเร็จ
Tag : PHP, MySQL, HTML/CSS, CakePHP
|
|
|
|
|
|
Date :
2015-06-11 17:15:28 |
By :
boombe007 |
View :
839 |
Reply :
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<?php
include("config.inc.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>แก้ไขเรียบร้อย</title>
</head>
<body>
<?php
$addquery = mysql_query("SELECT * FROM site_details WHERE site_num = '".$_POST["txtn_num"]."'");
$rows_add = mysql_fetch_array($addquery);
if(!$rows_add){
$sql= "INSERT INTO site_details (
site_id ,
site_name ,
site_sub ,
site_district ,
site_proince ,
site_latitude ,
site_logtitude ,
site_2g ,
site_3g ,
site_4g ,
site_ip3g ,
site_ip4g ,
site_trmpls ,
site_trptn ,
site_tratn ,
site_trmw ,
site_trcx600 ,
site_trdwdm ,
site_cb3g ,
site_cb4g ,
site_peamain ,
site_peasub ,
site_acmon ,
site_actue ,
site_acwed ,
site_acthu ,
site_acfri ,
site_acsat ,
site_acsun ,
site_acnote
)
VALUES ('".$_POST['txt_id']."', '".$_POST['txtname']."', '".$_POST['txtdistrict']."', '".$_POST['txtsub']."',
'".$_POST['txtproince']."', '".$_POST['txtlatitude']."', '".$_POST['txtlogtitude']."',
'".$_POST['txt2g']."', '".$_POST['txt3g']."', '".$_POST['txt4g']."',
'".$_POST['txtip3g']."', '".$_POST['txtip4g']."', '".$_POST['trmpls']."',
'".$_POST['trptn']."', '".$_POST['tratn']."', '".$_POST['trmw']."', '".$_POST['trcx600']."',
'".$_POST['trdwdm']."', '".$_POST['cb3g']."', '".$_POST['cb4g']."', '".$_POST['peamain']."',
'".$_POST['peasub']."', '".$_POST['acmon']."', '".$_POST['actue']."', '".$_POST['acwed']."',
'".$_POST['acthu']."', '".$_POST['acfri']."', '".$_POST['acsat']."', '".$_POST['acsun']."', '".$_POST['acnote']."')";
}else{
echo "เพิ่มไม่ได้";
}
echo $sql;
$dbquery = mysql_query($sql);
if($dbquery){
echo "สำเร็จ";
}
else{
echo "ไม่สำเร็จ";
}
mysql_close(); ?>
|
|
|
|
|
Date :
2015-06-11 18:43:55 |
By :
sabaitip |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ต่อสตริงได้น่ากลัวมาก เอาใจช่วยนะครับ
|
|
|
|
|
Date :
2015-06-11 19:24:30 |
By :
apisitp |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ได้แล้วครับ ขอบคุณมากๆนะครับ
|
|
|
|
|
Date :
2015-06-12 14:26:28 |
By :
boombe007 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|