<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; background-color: #577712; } .style1 { font-family: "Microsoft Sans Serif"; font-size: 16px; } --> </style></head> <body><? include('header.php'); ?> <? include 'connect.php'; $id_type=$_REQUEST[id_type]; ?> <table width="900" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="left" valign="top" bgcolor="#FFFFFF"><table width="900" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="200" align="left" valign="top"><? include('menu.php'); ?></td> <td width="615" align="left" valign="top"><table width="600" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="200" valign="top"><table width="100%" border="0" cellspacing="4"> <? $sql="SELECT * FROM product where ref_id_type='$id_type' GROUP BY name_prd "; $result=mysql_db_query($dbname,$sql); //$sql="select * from product where ref_id_type='$id_type_select' "; //$result=mysql_db_query($dbname,$sql); while ($rs=mysql_fetch_array($result)) { $id_prd=$rs[id_prd]; $code=sprintf("%05d",$id_prd); $name_prd=$rs[name_prd]; $detail_prd=$rs[detail_prd]; $ref_id_type=$rs[ref_id_type]; $price_prd=$rs[price_prd]; $photo_prd=$rs[photo_prd]; if ($photo_prd=="") { $photo_prd="temp.jpg"; } echo "<TR> <TD WIDTH='50%' VALIGN='top'> </B>$name_prd <BR> </TD> <TD WIDTH='50%' VALIGN='top'> <B><a href='product_detail.php?name_prd=$name_prd' target='_blank'>ดูรายละเอียด</a> </TD> </TR>"; } ?> </table> </td> </tr> </table></td> </tr> </table> <? include('footer.php'); ?></td> </tr> </table> </body> </html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; background-color: #577712; } .style3 { color: #0000FF; font-weight: bold; font-family: "Microsoft Sans Serif"; } .style4 {color: #FF00FF; font-weight: bold; font-family: "Microsoft Sans Serif", KodchiangUPC; } .style5 {font-size: 18px} --> </style></head> <body><? include('header.php'); include 'connect.php'; $name_prd=$_REQUEST[name_prd]; ?> <table width="900" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="left" valign="top" bgcolor="#FFFFFF"><table width="900" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="200" align="left" valign="top"><? include('menu.php'); ?></td> <td width="615" align="left" valign="top"><table width="600" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="200" valign="top"><br /> <? $sql="select * from product where name_prd='$name_prd' "; $result=mysql_db_query($dbname,$sql); while ($rs=mysql_fetch_array($result)) { $id_prd=$rs[id_prd]; $code=sprintf("%05d",$id_prd); $name_prd=$rs[name_prd]; $detail_prd=$rs[detail_prd]; $ref_id_type=$rs[ref_id_type]; $price_prd=$rs[price_prd]; $photo_prd=$rs[photo_prd]; if ($photo_prd=="") { $photo_prd="temp.jpg"; } echo "$price_prd"; echo " <a href='picture/$photo_prd' target='_blank' ><IMG SRC='picture/$photo_prd' width='200' height='200' border='0''></a>"; } echo "<table width='643' border='0' cellspacing='0' cellpadding='0'> <tr> <td colspan='2'> </td> </tr> <tr> <td></td> <td> $name_prd</td> </tr> <tr> <td></td> <td>$detail_prd </td> </tr> <tr> <td></td> <td>ราคา $price_prd บาท</td> </tr> </table>"; ?> </td> </tr> </table></td> </tr> </table> <? include('footer.php'); ?></td> </tr> </table> </body> </html>
Quote:$sql="select * from product where name_prd='$name_prd' "; 39. $result=mysql_db_query($dbname,$sql); mysql_query("SET NAMES UTF8");
mysql_query('SET NAMES utf8'); // bool // or mysql_set_charset('utf8');// bool // > mysql 5.0 // or iconv('tis620','utf8'); // string
// ต้องตรวจสอบ encoding ใน browser ที่ใช้งานครับ หรือ กับ document ก็ใช้ text editor ครับ
mysql_query("SET character_set_results=utf8"); $strcommand="select * from tb_picture where album_id='$album_id'"; $result=mysql_db_query($db,$strcommand,$conn);
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง