

<?

 $cat="category_id=";

 

  function itechitems_11($ssid,$cat)

                            {

 							$ss_sql="select * from site_categories where category_head_id=$ssid";

 							$sub_res=mysql_query($ss_sql);

    						while($cat_row=mysql_fetch_array($sub_res))

    						{

     						$cat_row[category_id];

     						$cat=$cat_row[category_id]." or category_id=";

     						if($cat_row['category_id'])

	 						{

	  						$ssid=$cat_row['category_id'];

	  						$_SESSION[catt]=$_SESSION[catt]."$cat";

	  						itechitems_11($ssid,$cat);

	 						}

   							}

  							}

 

 

 

 

 if($tot_rec>0)

 {

 while($cat_row=mysql_fetch_array($res))

 {

       $ssid=$cat_row[category_id];

	   $_SESSION[catt]=" ";

	   if($ssid)

      {

       $cat="category_id=$ssid or category_id= ";

	   $_SESSION[catt]=$cat;

       itechitems_11($ssid,$cat);

       $cat=$_SESSION[catt];

      }

	  $cat=rtrim($cat," or category_id=");

  }



 }

// $item_sql="select * from auction_details where ( $cat ) and status='Active' and selling_method='want_it_now' "; 

 $item_sql="select * from auction_details where category_id='$cate_id' and status='Active' and selling_method='want_it_now' and bid_starting_date <= now() "; 

 $recordset=mysql_query($item_sql);

 $total_records=mysql_num_rows($recordset);

 $limitsize=10;

 

  if($total_records>0)

{ 

//get the total records

if(strlen($currec)==0) //check firstpage 

$currec = 1;  

$start = ($currec - 1) * $limitsize;

$end = $limitsize;

$item_sql .=" limit $start,$end";

}

 ?>

