พอดีว่า ผมทำตารางบันทึกเวลาอยู่ ผมสร้าง ตารางเก็บข้อมูล 4 ตาราง ทั้ง 4 ตารางมีฟิลด์ที่เหมือนกันๆ คือ id,name,day,date แล้วผมก็สร้าง ฟอร์มการรับข้อมูลมา 4 ฟอร์ม
แบบว่า ฟอร์ม1 ใช้ตารางที่1 เรียกดูข้อมูลทุกได้ตาราง
คราวนี้ ผมต้องการที่จะถึงข้อมูลของ 4 ตารางออกมา ก็เลยสร้างอีกฟอร์ม1 ใช้ในการดึงข้อมูลออกมาโชว์ ให้แสดงผลเวลาของ 4 ช่่วงเวลาให้มาอยุ่ใน ตารางเดียวกัน ของแต่ละคน
มันไม่เป็นอย่างนั้น ไม่รู้ว่า โค้ดผิดตรงไหนคับ
<!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=windows-874" />
<title></title>
</head>
<body>
<?
include "connect.php";
include "function.php";
$sql="select *
from tb_time,tb_time1,tb_time2,tb_time3
group by name
"
;
$result=mysql_db_query($dbname,$sql);
echo "
<p><h 2>แสดง</h2>
<table width='100%' border='1' align='center'>
<tr bgcolor='#D2E9FF'>
<td width='13%'> <center><b><font size='2' face='MS Sans Serif'>วัน</font></b></center></td>
<td width='15%'> <center><b><font size='2' face='MS Sans Serif'>เวลาเข้า ตอนเช้า</font></b></center></td>
<td width='15%'> <center><b><font size='2' face='MS Sans Serif'>เวลาออก ตอนเช้า</font></b></center></td>
<td width='15%'> <center><b><font size='2' face='MS Sans Serif'>เวลาเข้า ตอนบ่าย</font></b></center></td>
<td width='15%'> <center><b><font size='2' face='MS Sans Serif'>เวลาออก ตอนบ่าย</font></b></center></td>
<td width='15%'> <center><b><font size='2' face='MS Sans Serif'>ชื่อ</font></b></center></td>
</tr>";
while($record=mysql_fetch_array($result)) {
$name=$record[name];
$day=$record[day];
$date=$record[date];
$date1=$record[date1];
$date2=$record[date2];
$date3=$record[date3];
$day=displaydate($day);
$name=htmlspecialchars($name);
$date=displaydate($date);
$date1=displaydate($date1);
$date2=displaydate($date2);
$date3=displaydate($date3);
echo "
<tr bgcolor='#FFFFFF'>
<td width='13%'> <font size='2' face='MS Sans Serif'>$day</a></font></td>
<td width='15%'> <center><font size='2' face='MS Sans Serif'>$date</font></center></td>
<td width='15%'> <center><font size='2' face='MS Sans Serif'>$date1</font></center></td>
<td width='15%'> <center><font size='2' face='MS Sans Serif'>$date2</font></center></td>
<td width='15%'> <center><font size='2' face='MS Sans Serif'>$date3</font></center></td>
<td width='15%'> <center><font size='2' face='MS Sans Serif'>$name</font></center></td>
</tr>";
} // end while
echo "</table>";
?>
<p> </p>
</body>
</html>
รบกวน ผู้รู้ดูโค้ดให้หน่อยครับ ทำตารางบันทึกเวลา
Moderators: mindphp, ผู้ดูแลกระดาน
- mindphp
- ผู้ดูแลระบบ MindPHP
- Posts: 27133
- Joined: 22/09/2008 6:18 pm
- Contact:
Re: รบกวน ผู้รู้ดูโค้ดให้หน่อยครับ
โค้ด ถ้าไม่ Error โค้ดไม่มีครับ อาจผิดที่ลอจิ
คำอธิบาย อ่านแล้วงงครับ
ปล.ลงโค้ดช่วยครอบโค้ดด้วยครับ
คำอธิบาย อ่านแล้วงงครับ
ปล.ลงโค้ดช่วยครอบโค้ดด้วยครับ
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
-
- Similar Topics
- Replies
- Views
- Last post
-
- 2 Replies
- 2262 Views
-
Last post by Dwight
11/01/2012 8:23 pm
-
-
ยกเลิก sms รบกวน ทุกเครือข่าย true ais dtak กด *137
by mindphp » 12/03/2014 1:23 am » in Mobile Programming - Android, iOS, Window Phone - 1 Replies
- 2417 Views
-
Last post by Ggy888
18/12/2014 9:50 am
-
-
-
รบกวน สอบถาม เจ้า Xampp มี เวอรชั่น win 7 , 64 bit ไหมคับ
by Tanpisit Moolpim » 11/01/2017 9:45 am » in Programming - PHP - 1 Replies
- 346 Views
-
Last post by mindphp
11/01/2017 2:34 pm
-
-
-
ยกเลิก sms รบกวน ทุกเครือข่าย true ais dtak กด *137 ยกเลิก SMS กินตัง
by mindphp » 12/03/2014 1:22 am » in Mobile Programming - Android, iOS, Window Phone - 5 Replies
- 4399 Views
-
Last post by ArcHeRRed
14/04/2020 7:34 pm
-
Who is online
Users browsing this forum: No registered users and 8 guests