require_once("./common.inc.php"); getget(); getpost(); $sys_perpage = 1; $sql = "SELECT * FROM `product` WHERE `display` = 1 and `category_id` = ".$cid." order by `sorting`"; $sql_start_pos = ($p-1) * $sys_perpage; $sql_limit = " LIMIT ".$sql_start_pos.", ".$sys_perpage; $result=mysql_query($sql.$sql_limit); $count=mysql_num_rows($result); $row = $db->fetch_array($result); //get attactment $sql2 = "SELECT * FROM `attachment` WHERE `table_name` = 'product' AND `table_id` = '".$row['id']."' AND `col_name`='attachment' order by sorting ASC, attachment_id ASC"; $result2 = mysql_query($sql2); $count2 = mysql_num_rows($result2); $while_count = 0; $attactment_list = ''; if($count2 > 0){ while($row2 = $db->fetch_array($result2)){ $attactment_list.='