|
 |
|
ช่วยดูให้ทีครับ query ข้อมูลออกมาซ้ำกัน (php+mysql) |
|
 |
|
|
 |
 |
|


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");
$detail_id = $_GET['id'];
$strSQL = "SELECT tb_name.*,tb_person.*,tb_education.*,tb_work.* FROM tb_name,tb_person,tb_education,tb_work $strSQL WHERE name_id='$detail_id' LIMIT 1";
//$strSQL = "SELECT * FROM tb_name,tb_person,tb_education,tb_work order by name_id,person_id,edu_id,work_id asc";
$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="145">ª×èÍ-¹ÒÁÊ¡ØÅ</td>
<td width="250"><?=$objResult["name"];?> <?=$objResult["fname"];?></td>
</tr>
<tr>
<td>ËÁÒÂàÅ¢»ÃШӵÑÇ</td>
<td><?=$objResult["cid"];?></td>
</tr>
<tr>
<td>Çѹà´×͹»Õà¡Ô´</td>
<td><?=$objResult["date"];?>/<?=$objResult["month"];?>/<?=$objResult["year"];?></td>
</tr>
<tr>
<td>ʶҹÐÀÒ¾</td>
<td><?=$objResult["s_marry"];?></td>
</tr>
<tr>
<td>¤ÙèÊÁÃÊ</td>
<td><?=$objResult["marryname"];?></td>
</tr>
<tr>
<td>¨Ó¹Ç¹ºØµÃ</td>
<td><?=$objResult["child"];?></td>
</tr>
<tr>
<td>·ÕèÍÂÙè»Ñ¨¨ØºÑ¹</td>
<td><?=$objResult["address"];?></td>
</tr>
<tr>
<td>ËÁÒÂàÅ¢â·ÃÈѾ·ì</td>
<td><?=$objResult["phone"];?></td>
</tr>
<tr>
<td>ÍÕàÁÅì</td>
<td><?=$objResult["mail"];?></td>
</tr>
<tr>
<td colspan="2">»ÃÐÇѵԡÒÃÈÖ¡ÉÒ</td>
</tr>
<tr>
<td>ÇزԡÒÃÈÖ¡ÉÒ</td>
<td><?=$objResult["degree"];?></td>
</tr>
<tr>
<td>ÇÔªÒàÍ¡</td>
<td><?=$objResult["major"];?></td>
</tr>
<tr>
<td>ʶҺѹ¡ÒÃÈÖ¡ÉÒ</td>
<td><?=$objResult["institute"];?></td>
</tr>
<tr>
<td>Çѹ·Õ診¡ÒÃÈÖ¡ÉÒ</td>
<td><?=$objResult["date2"];?>/<?=$objResult["month2"];?>/<?=$objResult["year2"];?></td>
</tr>
<tr>
<td colspan="2">ʶҹ·Õè·Ó§Ò¹</td>
</tr>
<tr>
<td>µÓá˹è§</td>
<td><?=$objResult["position"];?></td>
</tr>
<tr>
<td>Êѧ¡Ñ´Ë¹èǧҹ</td>
<td><?=$objResult["dept"];?></td>
</tr>
<tr>
<td>Çѹ·ÕèºÃèØ</td>
<td><?=$objResult["date3"];?>/<?=$objResult["month3"];?>/<?=$objResult["year3"];?></td>
</tr>
<tr>
<td>àÅ¢·Õèà§Ô¹à´×͹</td>
<td><?=$objResult["num_salary"];?></td>
</tr>
</table>
<br / >
<?
}
?>
<center><img src="images/printer.png" onClick="window.print()"></center>
</body>
Tag : PHP, MySQL

|
ประวัติการแก้ไข 2011-08-15 23:53:17
|
 |
 |
 |
 |
Date :
2011-08-15 23:49:48 |
By :
tossa |
View :
754 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แน่นใจ นะ ว่า ไม่ insert ข้อมูลซ้ำ
|
 |
 |
 |
 |
Date :
2011-08-16 01:29:40 |
By :
ckcr |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คุณดูในฐานข้อมูลมันซ้ำหรือเปล่าครับ
|
 |
 |
 |
 |
Date :
2011-08-16 06:37:42 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|