嗨,它只是不会返回我之前遇到过这个问题的所有图片,而且我真的不知道每当我将代码放在类文件中时是什么原因导致它
<?php
class get_pic{
function thumb($id){
$piclist = '';
if (isset($_GET['id'])) {
$id = preg_replace('#[^0-9]#i', '', $_GET['id']);
// Use this var to check to see if this ID exists, if yes then get the product
// details, if no then exit this script and give message why
$sql = mysql_query("SELECT * FROM productpic WHERE id='$id' ");
$productCount = mysql_num_rows($sql); // count the output amount
if ($productCount > 0) {
// get all the product details
while($row = mysql_fetch_array($sql)){
$path1 = $row["path1"];
$piclist ='<li id="thumb"><img id="thumb" style=" position:relative; border:#666 1px solid; " src="'.$path1.'" alt="' . $id . '" width="120" height="160" border="1" /></li>';
}
}
}
return $piclist;
}
}
?>