 |
ใครก็ได้ช่วยดูโค๊ด select นี้ให้หน่อยครับ select มาจากหลายตารางแล้วไม่ได้ |
|
 |
|
|
 |
 |
|

//////////////////////////////////////////////////////////code//////////////////////////////////////////////////////////////////////////////////////
<?php
if($_GET['txtquery'] != "")
{
mysql_query("SET NAMES TIS620");
$sql= "select * from lisadmin where ad_username='$sess_username1'";
$result=mysql_query($sql) or die ("ไม่สามารถเลือกฐานข้อมูลได้");
$r=mysql_fetch_array($result);
mysql_query("SET NAMES TIS620");
$strSQL1 = "SELECT a.*,b.*,c.*,d.* FROM crulis1 a,liscreator b,lissubjecthead c,lisadmin d WHERE a.id_lis=b.id_lis and a.id_lis=c.id_lis and a.id_admin=d.id_admin and a.id_admin='$r[id_admin]' and (a.Tile like '%".$_GET['txtquery']."%')";
$objQuery1 = mysql_query($strSQL1) or die ("Error Query [".$strSQL1."]");
$Num_Rows = mysql_num_rows($objQuery1);
$Per_Page =10; // Per Page
$Page = $_GET['Page'];
if(!$_GET['Page'])
{
$Page=1;
}
$Prev_Page = $Page-1;
$Next_Page = $Page+1;
$Page_Start = (($Per_Page*$Page)-$Per_Page);
if($Num_Rows<=$Per_Page)
{
$Num_Pages =1;
}
else if(($Num_Rows % $Per_Page)==0)
{
$Num_Pages =($Num_Rows/$Per_Page) ;
}
else
{
$Num_Pages =($Num_Rows/$Per_Page)+1;
$Num_Pages = (int)$Num_Pages;
}
$strSQL1 .=" order by a.id_lis DESC LIMIT $Page_Start , $Per_Page";
$objQuery1 = mysql_query($strSQL1);
while($r1 = mysql_fetch_array($objQuery1))
{
$count1++;
$id_lis=$r1['id_lis'];
$Title=$r1['Title'];
?>
<?php
echo"
<tr onmouseover=\"this.bgColor='#99CCFF'\" onmouseout=\"this.bgColor='#FFFFFF'\">
<td align='left'>$count1</td>
<td align='left'>";?><script type="text/javascript"src="wz_tooltip.js"></script>
<FONT class=f-m-ora onmouseover="Tip('<? echo "$Title";?>')"><? echo $message=substr("$Title",0,80)."..."; ?><? echo "</td><td align='left'><a href=\"delete.php?id_del=$id_lis\"
onclick=\"return confirm(' ต้องการลบลำดับที่ $count ออกใช่หรือไม่ ')\" class='text'>ลบ</a>/<A HREF=\"edit.php?id_lis=$id_lis\" target=\"$id_lis\" class='text'>แก้ไข</A></td>
</tr>";
}
}
?>
Tag : PHP, MySQL
|
|
 |
 |
 |
 |
Date :
2011-09-17 12:11:56 |
By :
comsc006 |
View :
918 |
Reply :
7 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
|