<?php 
require_once('Connections/localhost.php'); 
mysql_select_db($database_localhost,$localhost);
$page = $_POST['page'];

$query_search = "select * from tbl_product ";
$query_exec = mysql_query($query_search) or die(mysql_error());
$rows = mysql_num_rows($query_exec);

$query1 = mysql_query("select * from tbl_product");
$i = 1;
echo "Y%";
if($page == "1"){
while ($row=mysql_fetch_array($query1))
{
	if($i <= 10){
		echo "".$row['product_ID']."%".$row['product_NAME']."%".$row['product_TYPE']."%".$row['product_desc']."%".$row['product_PRICE']."%";
	}
	$i = $i + 1;
}
}
else if($page == "2"){
while ($row=mysql_fetch_array($query1))
{
	if($i <= 20 && $i > 10){
		echo "".$row['product_ID']."%".$row['product_NAME']."%".$row['product_TYPE']."%".$row['product_desc']."%".$row['product_PRICE']."%";
	}
	$i = $i + 1;
}
}

else if($page == "3"){
while ($row=mysql_fetch_array($query1))
{
	if($i <= 30 && $i > 20){
		echo "".$row['product_ID']."%".$row['product_NAME']."%".$row['product_TYPE']."%".$row['product_desc']."%".$row['product_PRICE']."%";
	}
	$i = $i + 1;
}
}

else if($page == "4"){
while ($row=mysql_fetch_array($query1))
{
	if($i <= 40 && $i > 30){
		echo "".$row['product_ID']."%".$row['product_NAME']."%".$row['product_TYPE']."%".$row['product_desc']."%".$row['product_PRICE']."%";
	}
	$i = $i + 1;
}
}

else if($page == "5"){
while ($row=mysql_fetch_array($query1))
{
	if($i <= 50 && $i > 40){
		echo "".$row['product_ID']."%".$row['product_NAME']."%".$row['product_TYPE']."%".$row['product_desc']."%".$row['product_PRICE']."%";
	}
	$i = $i + 1;
}
}
echo " ";
//mysql_query("Insert into mydatabase.tbl_user values('$ID','$useremail','$password')");


 //echo "<script language='javascript'>alert(".$row['username'].")</script>";
?>