|
 |
|
ข้อสอบถามค่ะพอดีกำลังศึกษาระบบสมาชิกแต่พอลองทำแล้วมันขึ้น error ค่ะ |
|
 |
|
|
 |
 |
|
พอดีเรากำลังศึกษาการสร้างระบบสมัครสมาชิกที่ฐานข้อมูลสร้างจากโปรแกรม Phpmyadmin และสร้างฟอร์มเพิ่มข้อมูลลงในฐานข้อมูล จาก Dreamweaver ค่ะ โดยฟังชั่นที่ออกแบบ คือให้ระบบ Search หาข้อมูลในสมาชิกในฐานข้อมูล และในตารางแสดงข้อมูลก็สามารถที่จะ แก้ไข เพิ่มข้อมูล และ ลบข้อมูล ของสมาชิกได้ค่ะ ทางเราศึกษาโค๊ดมาอีกทีและลองทำดูแต่พอทำเสร็จแล้วก็ขึ้น
Parse error: syntax error, unexpected $end in C:\AppServ\www\Insert_member.php on line 70Code (JavaScript)
<!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>
<?
mysql_connect("localhost", "root", "****") or die ('ไม่สามารถติดต่อ Database ได้');
mysql_db_query("$dbname","SET NAMES utf-8");
if($_POST[Submit]){
$sql = "INSERT INTO member ('member_ID','firstname','surname','status','Identification Number','birthday','Email','address','phoneNumber','Date registered','expiration date') VALUES('$_POST[member_ID]','$_POST[firstname]','$_POST[surname]','$_POST[status]','$_POST[Identificationnumber]','$_POST[birthday]','$_POST[Email]','$_POST[address]','$_POST[phonenumber]','$_POST[dateregistered]','$_POST[expirationdate]') ";
mysql_query($sql);
if($Search){
$result = mysql_query("SELECT * FROM member WHERE member_id LIKE '$_POST[keyword]%'
OR firstname LIKE '$_POST[keyword]%'");
}else{
$result = mysql_query("SELECT * FROM member");
}
?>
<div align="center">
<form name="form1" method="post" action="Insert_member">
<input name="keyword" type="text" id="keyword">
<input type="Submit" name="Search" value="Search...">
<tr><a href="insert_member.php">สมัครสมาชิกใหม่่</a><br></tr>
<table width="99%" height="155" cellpadding="0" cellspacing="0">
<tr>
<td width="10%" height="88"><div align="center">หมายเลขสมาชิก</div></td>
<td width="8%"><div align="center">ชื่อ </div></td>
<td width="8%"><div align="center">นามสกุล</div></td>
<td width="8%"><div align="center">สถานะ </div></td>
<td width="8%"><p>หมายเลขบัต</p>
<p>รประชาชน </p></td>
<td width="8%"><div align="center">ที่อยู่</div></td>
<td width="8%"><div align="center">Email</div></td>
<td width="8%"><div align="center">เบอร์ติดต่อ</div></td>
<td width="8%"><div align="center">วันที่เริ่มสมัคร </div></td>
<td width="10%"><div align="center">วันสิ้นสุดสมาชิก</div></td>
<td colspan="3"><div align="center">รายการ</div></td>
</tr>
<?
while($row = mysql_fetch_array($result)){
?>
<tr>
<td><? echo $row['member_ID']; ?></td>
<td><? echo $row['firstname']; ?></td>
<td><? echo $row['surname']; ?></td>
<td><? echo $row['stetus'];?></td>
<td><? echo $row['Identification Number']; ?></td>
<td><? echo $row['address']; ?></td>
<td><? echo $row['Email'];?> </td>
<td><? echo $row['phonenumber']; ?> </td>
<td><? echo $row['Date registered']; ?></td>
<td><? echo $row['expiration date']; ?></td>
<td width="5%">แก้ไข</td>
<td width="5%">ลบ</td>
<td width="6%">เพิ่ม</td>
</tr>
<? }?>
</table>
</form>
</body>
</html>
ไม่ทราบว่าเขียนโค๊ดผิดตรงไหนหรือเปล่าค่ะ
Tag : PHP, MySQL

|
ประวัติการแก้ไข 2014-08-14 13:51:38
|
 |
 |
 |
 |
Date :
2014-08-14 13:43:39 |
By :
ployjit |
View :
602 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ที่เห็นตอนนี้ปีกกาที่คู่กับ if($_POST[Submit]){ หายไปตัวนึง
|
ประวัติการแก้ไข 2014-08-14 13:51:57
 |
 |
 |
 |
Date :
2014-08-14 13:51:38 |
By :
sabaitip |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
<div align="center"> << เปิดแล้วลืมปิด ที่ 1 ครับ
|
 |
 |
 |
 |
Date :
2014-08-14 13:53:51 |
By :
Digitalhong |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|