ช่วยดูโค้ดหน้า update สมัครสมาชิก หา error ไม่เจอครับ
โค้ดหน้า update สมาชิก
Code (PHP)
<?php
session_start();
?>
<!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>
<?
$id=$_POST[id];
$Username=$_POST[User];
$Password=$_POST[Pass];
$Firstname=$_POST[Firstname];
$Lastname=$_POST[Lastname];
$Date=$_POST[Date];
$Month=$_POST[Month];
$Year=$_POST[Year];
$Age=$_POST[Age];
$ID_card=$_POST[ID_card];
$Sex=$_POST[Sex];
$Address=$_POST[Address];
$Province=$_POST[Province];
$Zipcode=$_POST[Zipcode];
$Email=$_POST[Email];
$Mobile=$_POST[Mobile];
$birth=$year.$month.$day;
/*
print "$id";
print "$Username";
print "$Password";
print "$Firstname";
print "$Lastname";
print "$Age";
print "$ID_card";
print "$Gender";
print "$Address";
print "$Province";
print "$Newprovince";
print "$Zipcode";
print "$Email";
print "$Mobile";
print "$t_num";
print "$t_name";
*/
$host="localhost";
$user="root";
$pass="1234";
$db="TBmember";
$con=mysql_connect($host,$user,$pass)
// เพิ่มข้อมูลลงในตาราง Member
บรรทัด 57 $sql="UPDATE member SET Username=$'Username',Password=$'Password',Firstname=$'Firstname',Lastname=$'Lastname',Age=$'Age',ID_card=$'ID_card',
Sex=$'Sex',Address=$'Address,Province=$'Province',Zipcode=$'Zipcode',Email='$Email ,Mobile=$'Mobile',birthday=$'birth where ID_Member='$id'";
mysql_query("SET NAMES utf8");
$result=mysql_db_query($db,$sql);
echo "<script>alert('ท่านได้แก้ไขข้อมูลสมาชิกเรียบร้อยแล้วครับ')</script>";
echo"<meta http-equiv='refresh' content='1;url=index.php'>";
?>
</body>
</html>
Parse error: syntax error, unexpected T_VARIABLE in C:\AppServ\www\Gunplasau\Save_update_member.php on line 57
โค้ดหน้าเชื่อมต่อ database dbconnect.php
Code (PHP)
<?php
$host="localhost";
$username="root";
$password="1234";
$db="TBmember";
$con=mysql_connect( $host,$username,$password);
?>
Tag : PHP, CakePHP
Date :
2012-12-11 17:04:09
By :
ponsau
View :
2359
Reply :
9
$ ครับ บรรทัด 57
Date :
2012-12-11 17:18:47
By :
Dragons_first
Code (PHP)
$sql="UPDATE member SET Username='$Username',...
น่าจะแบบนี้ครับ
Date :
2012-12-11 17:21:52
By :
mr.win
พี่วิน ผมเปลี่ยนแล้วเหมือนเดิมครับ
Date :
2012-12-11 18:06:28
By :
ponsau
<?php
session_start();
?>
<!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>
<?
$id=$_POST[id];
$Username=$_POST[User];
$Password=$_POST[Pass];
$Firstname=$_POST[Firstname];
$Lastname=$_POST[Lastname];
$Date=$_POST[Date];
$Month=$_POST[Month];
$Year=$_POST[Year];
$Age=$_POST[Age];
$ID_card=$_POST[ID_card];
$Sex=$_POST[Sex];
$Address=$_POST[Address];
$Province=$_POST[Province];
$Zipcode=$_POST[Zipcode];
$Email=$_POST[Email];
$Mobile=$_POST[Mobile];
$birth=$year.$month.$day;
/*
print "$id";
print "$Username";
print "$Password";
print "$Firstname";
print "$Lastname";
print "$Age";
print "$ID_card";
print "$Gender";
print "$Address";
print "$Province";
print "$Newprovince";
print "$Zipcode";
print "$Email";
print "$Mobile";
print "$t_num";
print "$t_name";
*/
$host="localhost";
$user="root";
$pass="1234";
$db="TBmember";
$con=mysql_connect($host,$user,$pass)
// เพิ่มข้อมูลลงในตาราง Member
$sql="UPDATE member SET Username='$username' ,Password='$Password' ,Firstname='$Firstname' ,Lastname='$Lastname' ,Age='$Age' ,ID_card='$ID_card'
,Sex='$Sex' ,Address='$Address ,Province='$Province' ,Zipcode='$Zipcode' ,Email='$Email ,Mobile='$Mobile' ,birthday='$birth where ID_Member='$id'";
mysql_query("SET NAMES utf8");
$result=mysql_db_query($db,$sql);
echo "<script>alert('ท่านได้แก้ไขข้อมูลสมาชิกเรียบร้อยแล้วครับ')</script>";
echo"<meta http-equiv='refresh' content='1;url=index.php'>";
?>
</body>
</html>
********************************************************************************************************************************************************
Parse error: syntax error, unexpected T_VARIABLE in C:\AppServ\www\Gunplasau\Save_update_member.php on line 57
Date :
2012-12-11 18:07:48
By :
ponsau
$con=mysql_connect($host,$user,$pass)
; หาย
Date :
2012-12-11 18:12:14
By :
ขำขำ
ได้แล้วครับ ขอบคุณครับ
Date :
2012-12-11 18:22:18
By :
ponsau
Address='$Address
Date :
2012-12-11 18:23:18
By :
นู๋น้อย
แป่ว มาช้าไป *-*
Date :
2012-12-11 18:23:45
By :
นู๋น้อย
Load balance : Server 03