กรุณาปิด AdBlock!

Cancel your adBlock please.

ขยายหน้าเว็บRegister Login
 โฆษณา
หน้า: [1]  ลงล่าง
  พิมพ์  
topic

while ($row=mysql_fetch_array($sql))  (อ่าน 5993 ครั้ง)

ไอที
« เมื่อ: 19, 02 2008, 11:26:14 AM »
ประมาณนี้
$sql "SELECT 
  `onebaht_product`.`pid`,
  `onebaht_product`.`topic`,
  `onebaht_product`.`color`,
  `onebaht_product_images`.`file`,
  `onebaht_product`.`adate`,
  `onebaht_product`.`price`
FROM
  `onebaht_product`
  LEFT OUTER JOIN `onebaht_product_images` ON (`onebaht_product`.`pid` = `onebaht_product_images`.`id`)
WHERE
`onebaht_product`.`color` IS NOT NULL
GROUP BY  onebaht_product.pid 
ORDER BY  rand() LIMIT 0,10"
;
$result mysql_query($sql$conn) or die(mysql_error());
while ( 
$row mysql_fetch_array($result)) {
$pic = ($row[file]!=NULL) ? 'tmb_'.$row[file] : 'noimage.gif';
echo "<tr>
    <td class=&#39;txtRandom&#39;><a href=&#39;?do=view&pid="
.$row[pid]."&#39; target=&#39;_blank&#39;>
	
<img src=&#39;./product_thumb/"
.$pic."&#39; align=&#39;center&#39;  class=&#39;imgr&#39;></td>
    <td valign=&#39;top&#39; class=&#39;txtRandom2&#39;><a href=&#39;?do=view&pid="
.$row[pid]."&#39; target=&#39;_blank&#39;>".limitText($row[topic],100)."</a><br />
          <span class=&#39;style3&#39;>"
.number_format($row[price])." B. </span></td>
  </tr>"
;
}
เด็กไอทีคลับ
เด็กไอทีตัวพ่อ
เด็กไอทีคลับชั้นเซียน
*
พลังความคิด 89
กระทู้: 3,536
บันทึกการเข้า
หน้า: [1]  ขึ้นบน
  พิมพ์  
 
กระโดดไป: