 |
|

คือต้องการใส่ a href ในช่องสถานะ ที่ขึ้นว่าค้างชำระทุกอันในตารางอ่ะคะ ให้มันขึ้นว่า ชำระงิน แต่ข้อมุลในตาราง มันดึงมาจากตารางหลายตารางในฐานข้อมูลอ่ะค่ะ แล้วเอามาเปรียบเทียบกัน ถึงจะออกมาเป็นตารางอันนั้นที่หน้าเว็บไซต์
โค้ด
Code (PHP)
<?php
session_start();
if (isset($_SESSION['login'])) { // อย่าลืม ต้องประการทุกครั้ง
echo "<center><p><p><b>ยินดีต้อนรับ... <font color='blue'>".$_SESSION['login']."</font></b></center>";
}else{
echo "<script type='text/javascript'>";
echo "windoe.location = 'error.php'";
echo "</script>";
}
include("connect01.inc");
$day_t0 = date("d-m-Y");
list($d, $m, $Y) = explode("-", $day_t0);
$Y = $Y+543;
$com_value = array("$d", "$m", "$Y");
$day_t1 = implode("-", $com_value);
$db = "asteriskproj";
$result = mysql_select_db($db);
mysql_query("SET NAMES UTF8");
if(!$result){
die('Could not find database called asteriskproj: '. mysql_error());
}
$sql = "SELECT member.name, stadium.stadium, time_fix.ti_fix, status.status FROM (member, stadium, time_fix, status) WHERE (member.id_card = stadium.namer and time_fix.num_fix = stadium.time and need_date = '$day_t1' and stadium.cash = status.num_st)";
$result = mysql_query($sql);
$num_rows = mysql_num_rows($result);
$num_fields = mysql_num_fields($result);
echo "<center>";
echo "<table bgcolor=00ff7f width=750px border=1px><tr><th>ชื่อผู้จอง</th><th>สนามที่</th><th>เวลาที่จอง</th><th>สถานะ</th></tr>";
$col = mysql_query($result);
while($row = mysql_fetch_row($col))
{
echo "<th>$row[0]</th>";
}
echo "</tr>";
$i = 0;
while($i<$num_rows){
$data = mysql_fetch_array($result);
echo "<tr align=\"center\">";
for($j=0; $j<$num_fields; $j++){
echo "<td>$data[$j]</td>";
}
echo "</tr>";
$i++;
}
echo "</table></center>";
mysql_close($link);
?>
เราสามารถจะใส่ได้ไหมคะ
Tag : PHP, MySQL
|
|
 |
 |
 |
 |
Date :
2014-05-23 15:54:39 |
By :
iiichoompuiii |
View :
1296 |
Reply :
3 |
|
 |
 |
 |
 |
|
|
|
 |