<? $type_id_select=$_GET[type_id]; include "top.php"; include "connect.php"; ?> <html> <head> <title>SA AUTO</title> <style type="text/css"> <!-- a:link { color: #0033CC; } a:visited { color: #0033CC; } a:hover { color: #FF0066; } a:active { color: #FF0066; } .style9 { color: #0000CC; font-size: 14px; font-weight: bold; } .style2 { color: #FFFF00; font-weight: bold; font-size: 24px; } .style10 {font-size: 24px} --> </style> <meta http-equiv="Content-Type" content="text/html; charset=windows-874"></head> <body background="../shops/pic/background.gif"> <table width="1257" border="1" align="center" cellpadding="1" cellspacing="1" bordercolor="#0099FF"> <tr> <td width="172"><img src="picture/1.png" width="172" height="32"></td> <td width="1072" bgcolor="#0099FF"><div align="center" class="style2 style10">:: ประเภทอะไหล่ :: </div></td> </tr> <tr> <td valign="top" bgcolor="#FFFFCC"><? include "connect.php"; include "type_car_list.php"; ?></td> <td bgcolor="#FFFFFF"><div align="center"> <table width="247" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="260" valign="top"><div align="center"> <table width="300%" border="0" align="center" cellspacing="4"> </table> <p></p> <?php $strSQL = "select * from car where type_id='$type_id_select' "; $objQuery = mysql_db_query($dbname, $strSQL); $Num_Rows = mysql_num_rows($objQuery); $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; } $sql="select * from car where type_id='$type_id_select' LIMIT $Page_Start , $Per_Page";//กำหนดจะให้เริ่มจาก1 $result = mysql_db_query($dbname, $sql); $num=mysql_num_rows($result ); if ($num>0) { echo "<table border=0 cellpadding=5 cellspacing=5 bordercolor='#425452'>"; $check=1; while($rs=mysql_fetch_array($result)) { $car_id=$rs[car_id]; $code_type_car=sprintf("%05d",$type_id); $car_name=$rs[car_name]; $type_id=$rs[type_id]; $car_pic=$rs[car_pic]; if ($car_pic ==""){ $car_pic="tmp.gif"; } if ($check%4 == 1) { echo "<tr>"; } echo" <td valign=top><a href='product_list.php?car_id=$car_id'> <img border='0' src='picture/car/$spare_type_pic' width='150' height='120' ></a></img> <br></a></img> <br> <center> <A HREF='product_list.php?car_id=$car_id'>$car_name</A></br> <br> </td>"; if ($check%4==0) { echo "</tr>"; $check=0; } $check++; } echo "</table>"; } ?> </div></td> </tr> </table> <p> </p> <p> </p> <p> <span class="newa"> <span class="style9">มีจำนวน Recored ทั้งหมด : <?= $Num_Rows;?> รวมทั้งหมด : <?=$Num_Pages;?> หน้า : <? if($Prev_Page) { echo " <a href='$_SERVER[SCRIPT_NAME]?type_id=$type_id_select&Page=$Prev_Page'><< Back</a> "; } for($i=1; $i<=$Num_Pages; $i++){ if($i != $Page) { echo "[ <a href='$_SERVER[SCRIPT_NAME]?type_id=$type_id_select&Page=$i'>$i</a> ]"; } else { echo "<b> $i </b>"; } } if($Page!=$Num_Pages) { echo " <a href ='$_SERVER[SCRIPT_NAME]?type_id=$type_id_select&Page=$Next_Page'>Next>></a> "; } mysql_close(); ?> </span></span></p> </div></td> </tr> </table> </body></html> <? include "foot.php"; ?>
$type_id_select=$_GET[type_id]; sql= "select * from car where type_id='$type_id_select' ";
$sql3="SELECT * FROM ชื่อตาราง"; $result3=odbc_exec($conn,$sql3); $rs3=odbc_fetch_array($result3); code connect $myServer="test"; $myDB="db_test"; $myUser="root"; $myPass="123456"; //$conn=mssql_connect($myServer, $myUser, $myPass) or die("ไม่สามารถติดต่อเซิร์ฟเวอร์ได้"); $connection_string = "DRIVER={SQL Server};SERVER=$myServer;DATABASE=$myDB;AutoTranslate=no"; //เป็นการกำหนด connection $conn = odbc_connect($connection_string,$myUser, $myPass) or die ("error connect"); //odbc_exec("SET NAMES tis620"); if($conn){ //echo "complete"; }else{ //echo "falie"; } //mssql_select_db($myDB);*/
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง