|
 |
|
อยากรบกวนเรื่องการ กำหนดการแสดงผลCode php หน้าเว็บ css |
|
 |
|
|
 |
 |
|
เมื่อดึงข้อมูลมาจาก db แล้ว ก็เรียกใช้ css จาก class ปกติ
เช่น
<table class=xxxx>
//เอาค่าที่ดึงจาก db มาใส่ ข้อมูลที่ได้ก็จะแสดงรูปแบบตาม class xxxx
</table>
เช่น
Code (PHP)
include "config/connect.php";
//ตัดมาให้ดู
print "<table class=simply>"; //เรียก class simply มาใช้
print "<tr>";
print "<th align = center width = 150 colspan=2> ".$code." ".$name_student." ".$sur_student." สาขา".$name_major."</th>";
print "</tr>";
print "<tr>";
print "<td align = left width = 150 colspan=2>รายชื่อกิจกรรม</td>";
print "</tr>";
$sqlData = "select * from ชื่อตาราง where code_student ='$code' " ;
$sqlqueryData=mysql_db_query($dbname, $sqlData);
$totalData = mysql_num_rows($sqlqueryData);
//echo $totalData;
$n = 1;
while($rsData = mysql_fetch_array($sqlqueryData))
{
$sql01 = "select * from tb_activity where id_activity =".$rsData['id_activity']."" ;
$sqlquery01=mysql_db_query($dbname, $sql01);
$rs01 = mysql_fetch_array($sqlquery01);
$t01 = mysql_num_rows($sqlquery01);
if($t01 ==""){
}else{
print "<tr>";
print "<td align = left width = 150 >กิจกรรมที่ ".$n."</td>";
print "<td height=35>".$rs01['name_activity']." </td>";
print "</tr>";}
$n++;
}
}
print"</table>";
ตรงตามต้องการหรือเปล่า
|
 |
 |
 |
 |
Date :
2012-07-26 08:45:01 |
By :
apisitp |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมอยากเรียนถามพี่อีกทีครับ
เนื่องจากผมใช้ div class ในการกำหนดการแสดงครับ
ตามcode ด้านล่างครับ
แต่เวลาแสดงแล้ว มันไม่ขึ้นแบบเรียงแถวที่ผมต้องการครับ
ข้อมูลผมมีใน database 5 อันครับ
ผมอยากให้แสดงแถวละ 4 อันครับ
แต่ตอนนี้ ผมใช้ code ตามข้างล่างแล้วครับ
แต่จะโชว์แบบ แถวละ 1 ครับ
ไม่ทราบว่า ต้องแก้ไขอย่างไรได้บ้างอ่ะครับ
ต้องขอรบกวนด้วยครับ
Code (PHP)
<div class="last_update browser left_col">
<h2>My Picture Gallery</h2>
<ul class="home_scenes_list">
<li>
<div class="widget-scene-230x147">
<div class="scene_230x147">
<?
$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
$objDB = mysql_select_db("mydatabase");
$strSQL = "SELECT * FROM files ORDER BY FilesID ASC";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
//$objResult = mysql_fetch_array($objQuery)
?>
<?php
$checkpp=1;
while($objResult = mysql_fetch_array($objQuery))
{
if ($checkpp%4 ==1)
{
echo "<TR>";
}
//echo $objResult["FilesID"];
?>
<a href="view.php?FilesID=<?php echo $objResult["FilesID"];?> "target="_blank"><img src="myfile/<?php echo$objResult["FilesPic"];?>" border="0"></a>
<?
if ($checkpp % 4 == 0)
{
echo "</TR>";
$checkpp=0;
}
$checkpp++;
}
?>
</div>
</div>
</div>
</ul>
|
 |
 |
 |
 |
Date :
2012-07-27 23:10:03 |
By :
chaikongkub |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอดันอีกรอบครับ
|
 |
 |
 |
 |
Date :
2012-07-28 11:30:58 |
By :
chaikongkub |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|