|
 |
|
ขอวอนคนใจดีช่วยดูโค๊ด นี้หน่อยค่ะ มันแก้ไขไม่ได้จนปัญญาจริงๆ |
|
 |
|
|
 |
 |
|
ช่วยดูหน่อยค่ะ จะแก้ไขข้อมูลแล้วมันไม่ยอมแก้ไขอ่ะค่ะ พอรันมันขึ้นว่า บันทึกข้อมูลสมาชิกไม่ได้
จนปัญญาแล้วจริงๆค่ะใครใจดีช่วยต่อโค๊ดหรือแก้ไขที่โค๊ดตัวหนังสือสีแดง ให้มันถูกให้หน่อยนะค่ะ ติดอยู่อย่างเดียวว TT^TT
แอดข้อมูลเข้าแล้วค่ะ ขอบคุณค่ะ
Code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<?php
include_once ("connection.php");
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>บันทึกข้อมูลสมาชิก</title>
</head>
<body>
<?php
$stat = $_GET["stat"];
if ($stat == "add") {
$mid = $_REQUEST["txtid"];
$muser = $_REQUEST["txtuser"];
$mpwd = $_REQUEST["txtpwd"];
$mfname = $_REQUEST["txtfname"];
$mlname = $_REQUEST["txtlname"];
$mgroup = $_REQUEST["txtstatus"];
$maddress = $_REQUEST["txtaddress"];
$mtel = $_REQUEST["txttel"];
$memail = $_REQUEST["txtemail"];
$sql = "insert into tblmember ";
$sql.= "(mid,username,password,fname,lname,status,address,tel,email)";
$sql .= " value('$mid','$muser','$mpwd','$mfname','$mlname','$mgroup','$maddress','$mtel','$memail')";
echo $sql;
mysql_query($sql) or die("บันทึกข้อมูลสมาชิกไม่ได้");
header("location:showmember.php");
} else if ($stat == "edit") {
$sql = "update tblmember set";
mysql_query($sql) or die("บันทึกข้อมูลสมาชิกไม่ได้");
header("location:showmember.php");
}
?>
</body>
</html>
Tag : PHP

|
|
 |
 |
 |
 |
Date :
2012-09-25 20:26:22 |
By :
งมโข่ง |
View :
973 |
Reply :
6 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<?php
include_once ("connection.php");
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>บันทึกข้อมูลสมาชิก</title>
</head>
<body>
<?php
$stat = $_GET["stat"];
if ($stat == "add") {
$mid = $_REQUEST["txtid"];
$muser = $_REQUEST["txtuser"];
$mpwd = $_REQUEST["txtpwd"];
$mfname = $_REQUEST["txtfname"];
$mlname = $_REQUEST["txtlname"];
$mgroup = $_REQUEST["txtstatus"];
$maddress = $_REQUEST["txtaddress"];
$mtel = $_REQUEST["txttel"];
$memail = $_REQUEST["txtemail"];
$sql = "insert into tblmember ";
$sql.= "(mid,username,password,fname,lname,status,address,tel,email)";
$sql .= " values('$mid','$muser','$mpwd','$mfname','$mlname','$mgroup','$maddress','$mtel','$memail')";
echo $sql;
mysql_query($sql) or die("บันทึกข้อมูลสมาชิกไม่ได้");
header("location:showmember.php");
} else if ($stat == "edit") {
$sql = "update tblmember set";
mysql_query($sql) or die("บันทึกข้อมูลสมาชิกไม่ได้");
header("location:showmember.php");
}
?>
</body>
</html>
|
ประวัติการแก้ไข 2012-09-25 20:38:32 2012-09-25 20:41:23
 |
 |
 |
 |
Date :
2012-09-25 20:34:05 |
By :
dekkuza |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แนะนำให้ใช้ HERE DOC
Code (PHP)
<?
$sql= <<<SQL
insert into xxx (x1,x2) values($x1,$x2);
SQ;
?>
|
 |
 |
 |
 |
Date :
2012-09-25 20:43:52 |
By :
dekkuza |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถ้ายังมีปัญหาให้ echo $sql ; มาดูครับว่ามาครบไหมถูกต้องไหม
|
 |
 |
 |
 |
Date :
2012-09-25 20:45:38 |
By :
dekkuza |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 05
|