getrow($sql); $i = 1; $photo_ary = array(); $sql = "SELECT attachment_id, `path`,`upload_date`,`file_name` FROM `tb_product_attachment` WHERE `table_name` = 'tb_product_list' AND `table_id` = '".$details['id']."' AND `col_name` LIKE 'photo%' ORDER BY `sorting`,attachment_id"; $rs2 = $db->query($sql); while ( $row2 = $db->fetch_array($rs2) ) { array_push ( $photo_ary, $row2 ); } if ($show=='') { $showvalue=1; } else $showvalue=$show; foreach ( $photo_ary as $k => $row2 ) { if ($i==$showvalue) { // ${"pic".$i} = ' ${"pic".$i} = ' $show) ${"pic".$i} = ' 0 && $_REQUEST['quantity']>0){ $pid=$_REQUEST['productid']; $quantity=$_REQUEST['quantity']; addtocart($pid,$quantity); // header("Location: shopping_cart.php"); echo ""; exit; } ?> Home >>> Products Details if ($showvalue=="1" || $show="" ) { echo $pic1.$pic2.$pic3.$pic4; } if ($showvalue=="2" ) { echo $pic2; echo $pic3; echo $pic4.$pic1 ; } if ($showvalue=="3" ) { echo $pic3.$pic4.$pic1.$pic2; } if ($showvalue=="4" ) { echo $pic4.$pic1.$pic2.$pic3; } // $temp=$show-1; // for ($temp; $temp >= 1; $temp--) // ${"pic".$temp} = ' // // '; ?> =$details['name']?> Item: =$details['name']?> Model: =$details['model']?> Availability: =($details['instock']=='Y'?'In Stock':'Out of Stock')?>Price: US$=$details['price_HKD']?> Add to Cart View Shopping Cart Description =$details['description']?>