|
 |
|
จะค้นหาข้อมูลการจอง โดยเชคจากวันที่ ทำยังไงคะ มีโค้ดมาให้ดูค่ะ |
|
 |
|
|
 |
 |
|
ผมไม่เห็น Table ว่าเป็นยังไง ไงก็ลองก่อนละกันครับ ผมจัดระเบียบสังคมให้ใหม่
Code (PHP)
<?
session_start();
include("connect.php");
?>
.
.
.
.
<?
$_SESSION["day"]=$_POST["day"];
$_SESSION["month"]=$_POST["month"];
$_SESSION["year"]=$_POST["year"]-543;
$_SESSION["recieve"]=$_SESSION["year"]."-".$_SESSION["month"]."-".$_SESSION["day"];//recieve post Format (0000:00:00)
$strSQL = "SELECT r.room_name, r.room_size, c.c_name, gd.date_start, gd.date_end
FROM generation_date gd
JOIN room r
ON gd.room_id = r.room_id
JOIN generation g
ON gd.gen_id = g.gen_id
JOIN course c
ON g.c_id = c.c_id
WHERE gd.date_start LIKE '%".$_SESSION["recieve"]."%'
ORDER BY gd.date_start ";
$objQuery = mysql_query($strSQL);
?>
<center>ตรวจสอบวันเวลาในการจอง</center><br/>
<table border="1" width="100%">
<tr>
<th width="5%">room</th>
<th width="10%">รุ่น</th>
<th width="10%">โครงการ</th>
<th width="10%">ชื่อห้อง</th>
<th width="10%">ขนาดห้อง</th>
<th width="19%">วันที่เริ่มจอง</th>
<th width="17%">วันสิ้นสุุดการจอง</th>
</tr>
</div>
<?
while($objResult = mysql_fetch_assoc($objQuery))
{
?>
<tr>
<td align="center"><?=$objResult["room_id"];?></td>
<td align="center"><?=$objResult["gen_id"];?></td>
<td align="center"><?=$objResult["c_name"];?></td>
<td align="center"><?=$objResult["roomname"];?></td>
<td align="center"><?=$objResult["roomsize"];?></td>
<td align="center"><?=$objResult["date_start"];?></td>
<td align="center"><?=$objResult["date_end"];?></td>
</tr>
<?
}
?>
</table>
|
ประวัติการแก้ไข 2011-12-25 02:10:19 2011-12-25 02:11:26 2011-12-25 02:11:31
 |
 |
 |
 |
Date :
2011-12-25 02:09:37 |
By :
kerb |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|

นี่ค่ะ table ที่จะดึงค่าออกมา
|
 |
 |
 |
 |
Date :
2011-12-25 13:58:46 |
By :
เด็กปี 4 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|