aqui esta el codigo por si ayuda a que me ayuden
Las consultas se llaman principal y consulpremium
Código PHP:
Ver original$currentPage = $_SERVER["PHP_SELF"];
$maxRows_principal = 10;
$pageNum_principal = 0;
if (isset($_GET['pageNum_principal'])) { $pageNum_principal = $_GET['pageNum_principal'];
}
$startRow_principal = $pageNum_principal * $maxRows_principal;
$varPrincipal_principal = "0";
if (isset($_GET["cat"])) { $varPrincipal_principal = $_GET["cat"];
}
$query_principal = sprintf("SELECT * FROM principal INNER JOIN categorias ON principal.id_categoria=categorias.id_categoria WHERE categorias.id_categoria=%s AND principal.premium=0 UNION SELECT * FROM principal INNER JOIN categorias ON principal.id_categoria=categorias.id_categoria WHERE categorias.IdPadre=%s AND principal.premium=0 ORDER BY id_principal DESC ", GetSQLValueString
($varPrincipal_principal, "int"),GetSQLValueString
($varPrincipal_principal, "int")); $query_limit_principal = sprintf("%s LIMIT %d, %d", $query_principal, $startRow_principal, $maxRows_principal);
if (isset($_GET['totalRows_principal'])) { $totalRows_principal = $_GET['totalRows_principal'];
} else {
}
$totalPages_principal = ceil($totalRows_principal/$maxRows_principal)-1;
$maxRows_ConsulPremium = 10;
$pageNum_ConsulPremium = 0;
if (isset($_GET['pageNum_ConsulPremium'])) { $pageNum_ConsulPremium = $_GET['pageNum_ConsulPremium'];
}
$startRow_ConsulPremium = $pageNum_ConsulPremium * $maxRows_ConsulPremium;
$varPremium_ConsulPremium = "0";
if (isset($_GET["cat"])) { $varPremium_ConsulPremium = $_GET["cat"];
}
$query_ConsulPremium = sprintf("SELECT * FROM principal INNER JOIN categorias ON (principal.id_categoria=categorias.id_categoria) WHERE categorias.id_categoria=%s AND premium=1 UNION SELECT * FROM principal INNER JOIN categorias ON (principal.id_categoria=categorias.id_categoria) WHERE categorias.IdPadre=%s AND premium=1 ORDER BY id_principal DESC ", GetSQLValueString
($varPremium_ConsulPremium, "int"),GetSQLValueString
($varPremium_ConsulPremium, "int")); $query_limit_ConsulPremium = sprintf("%s LIMIT %d, %d", $query_ConsulPremium, $startRow_ConsulPremium, $maxRows_ConsulPremium);
if (isset($_GET['totalRows_ConsulPremium'])) { $totalRows_ConsulPremium = $_GET['totalRows_ConsulPremium'];
} else {
$all_ConsulPremium = mysql_query($query_ConsulPremium); }
$totalPages_ConsulPremium = ceil($totalRows_ConsulPremium/$maxRows_ConsulPremium)-1;
$queryString_principal = "";
if (!empty($_SERVER['QUERY_STRING'])) { $params = explode("&", $_SERVER['QUERY_STRING']); foreach ($params as $param) {
if (stristr($param, "pageNum_principal") == false && stristr($param, "totalRows_principal") == false) { }
}
if (count($newParams) != 0) { }
}
$queryString_principal = sprintf("&totalRows_principal=%d%s", $totalRows_principal, $queryString_principal);