set_time_limit(0); @extract($_POST); @extract($_GET); @extract($_SESSION); include_once("includes/functions.php"); connect_db(); if($language == 'english'){ $dir_set = 'en'; $set_language = 'english'; $lan = 2; }elseif($language == 'thai'){ $dir_set = 'th'; $set_language = 'thai'; $lan = 1; }else{ $dir_set = 'th'; $set_language = 'thai'; $lan = 1; } ?> $Gallery_ID = array('0' =>''); $Gallery_Name = array('0' =>''); $Gallery_MainIcon = array('0' =>''); $Gallery_Detail = array('0' =>''); $Gallery_LanguageID = array('0' =>''); $Gallery_Type = array('0' =>''); $sSQL = "SELECT Gallery_ID, Gallery_Name, Gallery_MainIcon, Gallery_Detail, Gallery_Status, Gallery_Type, Gallery_LanguageID FROM ku_gallery WHERE Gallery_Type = '1' AND Gallery_LanguageID = '1' AND Gallery_Status = '1' ORDER BY Gallery_ID ASC"; $r=mysql_query($sSQL) or die("Query failed : " . mysql_error()); while($rs = mysql_fetch_array($r)) { $Gallery_ID[] =$rs['Gallery_ID']; $Gallery_Name[] =$rs['Gallery_Name']; $Gallery_MainIcon[] =$rs['Gallery_MainIcon']; $Gallery_Detail[] =$rs['Gallery_Detail']; $Gallery_LanguageID[] =$rs['Gallery_LanguageID']; $Gallery_Type[] =$rs['Gallery_Type']; } if (!(isset($from))) { $from = 1; } $totalhits = mysql_num_rows ($r); if ($totalhits > 0) { $totalpage = ceil($totalhits / $numresults); $page = ceil($from / $numresults); $st = (floor(($page-1) / 10) * 10) +1; $fn = $st + $numresults-1; if ($fn > $totalpage) $fn = $totalpage; if ($from + $numresults > $totalhits) { $nloop = $totalhits; } else { $nloop = $from + $numresults - 1; } $i=$from; $ii=$from; #print_r($Gallery_ID); ?>