I want to fetch two record in foreach loop.
After fetch record, next two record for pagination
$post_img_id=array(21,24,25,28,40,44,46,47,52,78,88,89,92,101); //this is id of table data
$total=count($post_img_id,COUNT_RECURSIVE); //total record
$item=2;
$total_page=ceil($total/$item);
$cur_page=isset($_GET['page'])?$_GET['page']:1;
$k=($cur_page-1)*$item;
foreach($post_img_id as $id)
{
if($co<=10){
$post_img_q="select * from $post where id=$id LIMIT $k,$item";
$post_img_res=mysql_query($post_img_q) or die(mysql_error());
while($post_img_row=mysql_fetch_assoc($post_img_res))
{
echo 'record';
}
}
?>
how to solve this problem ? please help me !
Thanx for Advance !