|
|
|
อยากให้เฟสข้อมูลจากตาราง 2 ตารางครับ รบกวนช่วยดูโค๊ดให้ที่ครับ |
|
|
|
|
|
|
|
Code (PHP)
$sql = "SELECT researcher,institution,tel,types,pic FROM tbl_attend,tbl_researcher,tbl_institution,tbl_type WHERE tbl_researcher.id_researcher = tbl_attend.id_researcher AND tbl_institution.id_institution = tbl_attend.id_institution AND tbl_type.id_type = tbl_attend.id_type AND tbl_attend.id_type = '1' order by tbl_attend.id_researcher limit $goto,$list_page";
$sql1 = "SELECT * FROM tbl_bold WHERE id_type = '1'";
$dbquery = mysql_db_query($dbname, $sql);
while ($result = mysql_fetch_array($dbquery))
{
$id_pro = $result[id_pro];
$researcher = $result[researcher];
$institution = $result[institution];
//$special = $result[special];
$tel = $result[tel];
$types = $result[types];
$pic = $result[pic];
$name_pic = "../images/person/$pic";
$name_picn = "../images/person/noperson";
$n++;
//$n--;
If ($bg=="#D5D5D5"){$bg="#E5E5E5";}Else{$bg="#D5D5D5";}
?>
<tr bgcolor="<?=$bg;?>">
<td align=center valign="middle" nowrap><font color="#3d3d3d">
<?=$n;?>
.</font></td>
<td align="left" valign="middle" nowrap><font color="#3d3d3d">
<?=$researcher;?>
</font></td>
<td align="center" valign="middle" nowrap><font color="#3d3d3d">
<?=$institution;?>
</font></td>
<td align="center" valign="middle" nowrap><font color="#3d3d3d">
<?=$tel;?>
</font></td>
<td align="center" valign="middle" nowrap><font color="#3d3d3d">
<?=$special;?>
</font></td>
<td align="center" valign="middle" nowrap><font color="#3d3d3d">
<?=$types;?>
</font></td>
<td align="center" valign="middle" nowrap><? if($pic!=""){?>
<a href="<?=$name_pic;?>"><img src="<?=$name_pic;?>" alt="" width="110" height="130" border="0"></a>
<? } else {?>
<img src="<?=$name_picn;?>" alt="" width="110" height="130" border="0">
<? } ?></td>
</tr>
<? }?>
Tag : PHP, CakePHP
|
|
|
|
|
|
Date :
2011-03-31 19:28:42 |
By :
fujisawa10 |
View :
741 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ดูแล้วครับ แต่ไม่รู้่จะตอบยังไง เพราะไม่มีข้อมูลและคำถามพอที่จะตอบได้
|
|
|
|
|
Date :
2011-03-31 22:07:00 |
By :
PlaKriM |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|