|
|
|
เรื่องการ query ข้อมูล มันแสดงข้อมูลออกมายาวต่อกันเลยครับ |
|
|
|
|
|
|
|
Code (PHP)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> ¢éÍÁÙźؤÅÒ¡Ã</TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<style type="text/css">
<!--
.style2 {font-size: small}
-->
</style></head>
<body>
<?include("connect.php");
$strSQL = "SELECT * FROM tb_name,tb_person,tb_education,tb_work";
//$strSQL = "SELECT tb_name.*,tb_person.*,tb_education.*,tb_work.* FROM tb_name,tb_person,tb_education,tb_work";
//$strSQL = "SELECT * FROM tb_name,tb_person,tb_education,tb_work";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$Num_Rows = mysql_num_rows($objQuery);
mysql_query("SET NAMES TIS620");
if($Num_Rows==0){
echo "<font size=-1 face='Tahoma'>äÁèÊÒÁÒöáÊ´§¢éÍÁÙÅä´é</font><br><br>\n";
}
?>
<?
while($objResult = mysql_fetch_array($objQuery))
{
?>
<table width="409" border="0" align="center" >
<tr>
<td colspan="2">¢éÍÁÙÅÊèǹµÑÇ</td>
</tr>
<tr>
<td width="139">ª×èÍ-¹ÒÁÊ¡ØÅ</td>
<td width="182"><?=$objResult["name"];?> <?=$objResult["fname"];?></td>
</tr>
<tr>
<td>ËÁÒÂàÅ¢»ÃШӵÑÇ</td>
<td><?=$objResult["cid"];?></td>
</tr>
<tr>
<td>Çѹà´×͹»Õà¡Ô´</td>
<td> </td>
</tr>
<tr>
<td>ʶҹÐÀÒ¾</td>
<td> </td>
</tr>
<tr>
<td>¤ÙèÊÁÃÊ</td>
<td> </td>
</tr>
<tr>
<td>¨Ó¹Ç¹ºØµÃ</td>
<td> </td>
</tr>
<tr>
<td>·ÕèÍÂÙè»Ñ¨¨ØºÑ¹</td>
<td> </td>
</tr>
<tr>
<td>ËÁÒÂàÅ¢â·ÃÈѾ·ì</td>
<td> </td>
</tr>
<tr>
<td>ÍÕàÁÅì</td>
<td> </td>
</tr>
<tr>
<td colspan="2">»ÃÐÇѵԡÒÃÈÖ¡ÉÒ</td>
</tr>
<tr>
<td>ÇزԡÒÃÈÖ¡ÉÒ</td>
<td> </td>
</tr>
<tr>
<td>ÇÔªÒàÍ¡</td>
<td> </td>
</tr>
<tr>
<td>ÊÒ¢ÒÇÔªÒ</td>
<td> </td>
</tr>
<tr>
<td>Çѹ·Õ診¡ÒÃÈÖ¡ÉÒ</td>
<td> </td>
</tr>
<tr>
<td colspan="2">ʶҹ·Õè·Ó§Ò¹</td>
</tr>
<tr>
<td>µÓá˹è§</td>
<td> </td>
</tr>
<tr>
<td>Êѧ¡Ñ´Ë¹èǧҹ</td>
<td> </td>
</tr>
<tr>
<td>Çѹ·ÕèºÃèØ</td>
<td> </td>
</tr>
<tr>
<td>àÅ¢·Õèà§Ô¹à´×͹</td>
<td> </td>
</tr>
</table>
<?
}
?>
</body>
มันแสดงผลแล้วข้อมูล แสดงต่อแถวยาว เลยต้องแก้ไขคำสั่ง อย่าไรครับ
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2011-07-28 14:15:41 |
By :
tossa |
View :
819 |
Reply :
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> ¢éÍÁÙźؤÅÒ¡Ã</TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<style type="text/css">
<!--
.style2 {font-size: small}
-->
</style></head>
<body>
<?include("connect.php");
$strSQL = "SELECT * FROM tb_name,tb_person,tb_education,tb_work";
//$strSQL = "SELECT tb_name.*,tb_person.*,tb_education.*,tb_work.* FROM tb_name,tb_person,tb_education,tb_work";
//$strSQL = "SELECT * FROM tb_name,tb_person,tb_education,tb_work";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$Num_Rows = mysql_num_rows($objQuery);
mysql_query("SET NAMES TIS620");
if($Num_Rows==0){
echo "<font size=-1 face='Tahoma'>äÁèÊÒÁÒöáÊ´§¢éÍÁÙÅä´é</font><br><br>\n";
}
?>
<?
while($objResult = mysql_fetch_array($objQuery))
{
?>
<table width="409" border="0" align="center" >
<tr>
<td colspan="2">¢éÍÁÙÅÊèǹµÑÇ</td>
</tr>
<tr>
<td width="139">ª×èÍ-¹ÒÁÊ¡ØÅ</td>
<td width="182"><?=$objResult["name"];?> <?=$objResult["fname"];?></td>
</tr>
<tr>
<td>ËÁÒÂàÅ¢»ÃШӵÑÇ</td>
<td><?=$objResult["cid"];?></td>
</tr>
<tr>
<td>Çѹà´×͹»Õà¡Ô´</td>
<td> </td>
</tr>
<tr>
<td>ʶҹÐÀÒ¾</td>
<td> </td>
</tr>
<tr>
<td>¤ÙèÊÁÃÊ</td>
<td> </td>
</tr>
<tr>
<td>¨Ó¹Ç¹ºØµÃ</td>
<td> </td>
</tr>
<tr>
<td>·ÕèÍÂÙè»Ñ¨¨ØºÑ¹</td>
<td> </td>
</tr>
<tr>
<td>ËÁÒÂàÅ¢â·ÃÈѾ·ì</td>
<td> </td>
</tr>
<tr>
<td>ÍÕàÁÅì</td>
<td> </td>
</tr>
<tr>
<td colspan="2">»ÃÐÇѵԡÒÃÈÖ¡ÉÒ</td>
</tr>
<tr>
<td>ÇزԡÒÃÈÖ¡ÉÒ</td>
<td> </td>
</tr>
<tr>
<td>ÇÔªÒàÍ¡</td>
<td> </td>
</tr>
<tr>
<td>ÊÒ¢ÒÇÔªÒ</td>
<td> </td>
</tr>
<tr>
<td>Çѹ·Õ診¡ÒÃÈÖ¡ÉÒ</td>
<td> </td>
</tr>
<tr>
<td colspan="2">ʶҹ·Õè·Ó§Ò¹</td>
</tr>
<tr>
<td>µÓá˹è§</td>
<td> </td>
</tr>
<tr>
<td>Êѧ¡Ñ´Ë¹èǧҹ</td>
<td> </td>
</tr>
<tr>
<td>Çѹ·ÕèºÃèØ</td>
<td> </td>
</tr>
<tr>
<td>àÅ¢·Õèà§Ô¹à´×͹</td>
<td> </td>
</tr>
</table>
<br />
<?
}
?>
</body>
|
|
|
|
|
Date :
2011-07-28 14:22:18 |
By :
adaaugusta |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
แก้ตรงไหนเหรอครับ
|
|
|
|
|
Date :
2011-07-28 14:29:54 |
By :
tossa |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ใส่ <br /> หลัง </table> ครับ
|
|
|
|
|
Date :
2011-07-28 14:53:58 |
By :
tomrambo |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
มันแสดงแบบนี้อะครับ
|
|
|
|
|
Date :
2011-07-28 15:06:20 |
By :
tossa |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
<td width="145">ª×èÍ-¹ÒÁÊ¡ØÅ</td>
<td width="250"><?=$objResult["name"];?> <?=$objResult["fname"];?></td>
</tr>
|
|
|
|
|
Date :
2011-07-28 15:44:05 |
By :
avsqlz |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|