ขึ้นแบบนี้อ่ะ Parse error: syntax error, unexpected $end in C:\AppServ\www\project_travel\admin_manage_destination.php on line 140
ช่วยดูให้หน่อย จะให้มันแสดงข้อมูลที่ดึงมาจากฐานข้อมูล
นี่ code ทั้งหมด
<? ob_start() ?>
<?php
/* call connectFunction in function.php */
require_once('function.php');
connect();
/* use $_SESSION send value from check.php */
@session_start();
$username = $_SESSION['username_log'];
/* check for get value from check.php */
if($username != ""){
$query = mysql_query(" select * from login where username='$username_log';");
if(!$query){
print "<label style='color:red;'>เกิดข้อผิดพลาดเกี่ยวกับข้อมูลบุคลากร</label>";
}
else{
$record = mysql_fetch_array($query);
$username = $record['username_log'];
}
}else{
header("Location: login.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>
<style>
.menu{margin:0; padding:0; width:200px; list-style:none;background:rgb(/255,255,255);}
.menu li{padding:0; margin:0 0 1px 0; height:40px; display:block; }
.menu li a{text-align:left;height:40px; padding:0px 25px; font:16px Verdana, Arial, Helvetica, sans-serif; color:rgb(255,255,255); display:block; background:url('images/verMenuImages22.png') 0px 0px no-repeat; text-decoration:none; outline:none;}
.menu li a:hover{background:url('images/verMenuImages22.png') 0px -40px no-repeat; color:rgb(255,255,255);}
.menu li a.active, .menu li a.active:hover{background:url('images/verMenuImages22.png') 0px -0px no-repeat; color:rgb(255,255,255);}
.menu li a span{line-height:40px;}
body {
background-image: url(images/bacgground_standard.jpg);
background-color: #DDDDDD;
}
</style>
<script language="JavaScript">
<!--
function mmLoadMenus() {
if (window.mm_menu_0718202206_0) return;
window.mm_menu_0718202206_0 = new Menu("root",85,26,"Microsoft Sans Serif, Tahoma",20,"#000000","#000000","#C4E1FF","#FFFFFF","center","middle",3,0,1000,-5,7,true,true,true,0,true,true);
mm_menu_0718202206_0.addMenuItem("วัด","window.open('map.html', '_blank');");
mm_menu_0718202206_0.addMenuItem("ธรรมชาติ","window.open('map.html', '_blank');");
mm_menu_0718202206_0.addMenuItem("พิพิธภัณฑ์","window.open('map.html', '_blank');");
mm_menu_0718202206_0.addMenuItem("อื่นๆ","window.open('map.html', '_blank');");
mm_menu_0718202206_0.hideOnMouseOut=true;
mm_menu_0718202206_0.bgColor='#FFFFFF';
mm_menu_0718202206_0.menuBorder=1;
mm_menu_0718202206_0.menuLiteBgColor='#FFFFFF';
mm_menu_0718202206_0.menuBorderBgColor='#FFFFFF';
mm_menu_0718202206_0.writeMenus();
} // mmLoadMenus()
//-->
</script>
<script language="JavaScript" src="mm_menu.js"></script>
</head>
<body>
<script language="JavaScript1.2">mmLoadMenus();</script>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="23" align="right" valign="top"><img src="images/0_01.gif" width="17" height="17" /></td>
<td colspan="3" valign="top"><img src="images/0_05.gif" width="1007" height="17" /></td>
<td width="20"><img src="images/0_02.gif" width="18" height="17" /></td>
</tr>
<tr>
<td rowspan="6" valign="top" background="images/0_06.gif"> </td>
<td height="233" colspan="3" align="left" valign="top"><img src="images/h00111.jpg" width="1007" height="226" /></td>
<td rowspan="6" valign="top" background="images/0_07.gif"> </td>
</tr>
<tr>
<td width="200" height="58" align="left" valign="top"> </td>
<td width="519" valign="top"><strong><img src="images/bg_post_title copy.jpg" width="526" height="59" /><br />
</strong></td>
<td width="171" align="left" valign="top"><? echo $username_log; ?>
<a href="logout.php">logout</a> </td>
</tr>
<tr>
<td rowspan="3" align="left" valign="top"><ul class="menu"><li><a href="/contact" name="link1" id="link1" onmouseover="MM_showMenu(window.mm_menu_0718202206_0,134,18,null,'link1')" onmouseout="MM_startTimeout();"><span>เลือกสถานที่ท่องเที่ยว</span></a></li>
<li><a href="/contact"><span>สถานที่ซื้อของฝาก</span></a></li>
<li><a href="/contact"><span>ข้อมูลค่าน้ำมัน</span></a></li>
<li><a href="/contact"><span>ข้อมูลค่าเข้าชม</span></a></li>
</ul></td>
<td rowspan="3" align="left" valign="top"><form name="destination" method="post" action="admin_manage_destination.php">
<table align='center' border='1' width='540'>
<tr>
<td height="61" colspan='4' align="left" valign="bottom"><b> DESTINATION_TYPE</b>
<p> </p> </td>
</tr>
<tr align='center'>
<td width='105' height="34" ><strong>TPYE_ID</strong></td>
<td width="149"><b>TYPE_NAME</b></td>
<td width='114'><b>EDIT</b></td>
<td width='144'><b>DELETE</b></td>
</tr>
<tr nowrap="nowrap">
<?php
$query_select = mysql_query("SELECT * FROM destination_type;");
while($record = mysql_fetch_array($query_select)){
?>
<td><?php echo $record["type_id"] ?></td>
<td><?php echo $record["type_name"] ?></td>
<td align="center">Edit</td>
<td align="center">Delete</td>
</tr>
<tr nowrap="nowrap">
<td colspan='4'><input type='submit' name='cmd_add' value='ADD' />
<input type='button' name='cmd_mainmenu' value='MAINMENU' onclick="javascript: location.href='index.php';" /></td>
</tr>
</table>
</form>
</td>
<td height="24" align="left" valign="top"><p align="center"><strong>อัตราน้ำมันวันนี้</strong></p></td>
</tr>
<tr>
<td height="140" align="left" valign="top"><iframe src="http://www.pttplc.com/th/oilprice.asp" width="170" height="257" frameborder="0" marginheight="0" marginwidth="0" scrolling="no"></iframe></td>
</tr>
<tr>
<td height="248" align="left" valign="top"> </td>
</tr>
<tr>
<td height="51" colspan="3" align="left" valign="top"><img src="images/footer11.jpg" width="1004" height="144" /></td>
</tr>
<tr>
<td height="16" valign="top"><img src="images/0_03.gif" width="17" height="16" /></td>
<td colspan="3" valign="top"><img src="images/0_08.gif" width="1007" height="16" /></td>
<td valign="top"><img src="images/0_04.gif" width="18" height="16" /></td>
</tr>
</table>
</body>
</html>
<? ob_end_flush() ?>Tag : PHP, MySQL
Date :
2011-08-23 01:26:34
By :
bb
View :
856
Reply :
7
ให้เลือก PHP Code ก่อน มา โพส นะ ครับ นับไม่ใหว
Date :
2011-08-23 01:49:22
By :
Professer
ช่วยตอบหน่อย
Date :
2011-08-23 02:08:18
By :
bb
ตอนนี้ข้อมูลขึ้นแล้ว แล้วขึ้นแค่ record เดียว
<? ob_start() ?>
<?php
/* call connectFunction in function.php */
require_once('function.php');
connect();
/* use $_SESSION send value from check.php */
@session_start();
$username = $_SESSION['username_log'];
/* check for get value from check.php */
if($username != ""){
$query = mysql_query("SELECT * FROM login WHERE username='".$username."';");
if(!$query){
print "<label style='color:red;'>เกิดข้อผิดพลาดเกี่ยวกับข้อมูลบุคลากร</label>";
}
else{
$record = mysql_fetch_array($query);
$username = $record['username_log'];
}
}else{
header("Location: login.php");
}
?>
<?php
$query_select = mysql_query("SELECT * FROM destination_type;");
while($record = mysql_fetch_array($query_select)){
$type_id = $record['type_id'];
$type_name = $record['type_name'];
}
?>
<td><?php echo $type_id; ?></td>
<td><?php echo $type_name; ?></td>
<td align="center">Edit</td>
<td align="center">Delete</td>
</tr>
<tr nowrap="nowrap">
<td><?php echo $type_id; ?></td>
<td><?php echo $type_name; ?></td>
<td align="center">Edit</td>
<td align="center">Delete</td>
<? ob_end_flush() ?>
เฉพาะ php code คะ
Date :
2011-08-23 02:12:21
By :
bb
ลืมปิด while($record = mysql_fetch_array($query_select)){
Date :
2011-08-23 02:12:59
By :
ikikkok
ขอบคุณคะ
Date :
2011-08-24 20:54:15
By :
bb
Load balance : Server 02