XIM Posted November 14, 2012 Report Share Posted November 14, 2012 (edited) Amigos sou eu denovo,tenho este script,tenho o produto cadastrado,me mostra que tem " Registros 1 a 1 de 1", mas não aparece nada só estes dizeres,se puderem me ajudar ficarei muito agradecido,um forte abraço a todos.<?php require_once('Connections/conexao.php'); ?><?php$currentPage = $_SERVER["PHP_SELF"];$maxRows_Recordset1 = 13;$pageNum_Recordset1 = 0;if (isset($_GET['pageNum_Recordset1'])) {$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];}$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;$colname_Recordset1 = "1";if (isset($_GET['cod_cat'])) {$colname_Recordset1 = (get_magic_quotes_gpc()) ? $_GET['cod_cat'] : addslashes($_GET['cod_cat']);}mysql_select_db($database_conexao, $conexao);$query_Recordset1 = sprintf("SELECT * FROM produtos WHERE cod_cat = %s", $colname_Recordset1);$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);$Recordset1 = mysql_query($query_limit_Recordset1, $conexao) or die(mysql_error());$row_Recordset1 = mysql_fetch_assoc($Recordset1);if (isset($_GET['totalRows_Recordset1'])) { $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];} else { $all_Recordset1 = mysql_query($query_Recordset1); $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);}$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;$queryString_Recordset1 = "";if (!empty($_SERVER['QUERY_STRING'])) { $params = explode("&", $_SERVER['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, "pageNum_Recordset1") == false && stristr($param, "totalRows_Recordset1") == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_Recordset1 = "&" . implode("&", $newParams); }}$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);?><script language=JavaScript" type="text/JavaScript"><!--function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features);}//--></script><div align="center"> <?php if ($totalRows_Recordset1 == 0) { // Show if recordset empty ?> No momento não dispomos de nenhum produto para essa categoria. <?php } // Show if recordset empty ?> <br> <?php do { ?> <?php if ($totalRows_Recordset1 > 0) { // Show if recordset not empty ?><?php$cont = "0"; //Define o valor da variávelecho "<table width=\"88%\" height=\"10\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>"; //Inicia a tabelawhile($row_Recordset1 = mysql_fetch_assoc($Recordset1)){ //Loop até encontrar o resultado desejado(talvez não seja isso que está escrito).if($cont == "4"){ //Se a variável possuir valor 3, fecha a linha atual e inicia outra linha(da tabela) e retorna o valor da variável para zero. echo "</tr><tr>"; $cont = "0";}echo "<td align=center ><img src='".$row_Recordset1['fot_peq]."' width='100' height='100' border='0'><br>";echo $row_Recordset1['nome_prod']."<br>";echo $row_Recordset1['descricao']."<br>";echo '<a href=detalhes.php?cod_prod='.$row_Recordset1['cod_prod].'">Ver Detalhes</a>';echo "</td>";$cont++;} ?> <?php } // Show if recordset not empty ?> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));mysql_free_result($Recordset1);?> <p> Registros <?php echo ($startRow_Recordset1 + 1) ?> a <?php echo min($startRow_Recordset1 + $maxRows_Recordset1, $totalRows_Recordset1) ?> de <?php echo $totalRows_Recordset1 ?> <table border="0" width="50%" align="center"> <tr> <td width="23%" align="center"> <?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?> <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, 0, $queryString_Recordset1); ?>">Primeiro</a> <?php } // Show if not first page ?> </td> <td width="31%" align="center"> <?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?> <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, max(0, $pageNum_Recordset1 - 1), $queryString_Recordset1); ?>">Retornar</a> <?php } // Show if not first page ?> </td> <td width="23%" align="center"> <?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?> <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); ?>">Avançar</a> <?php } // Show if not last page ?> </td> <td width="23%" align="center"> <?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?> <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, $totalPages_Recordset1, $queryString_Recordset1); ?>">Último</a> <?php } // Show if not last page ?> </td> </tr> </table></p> </div> Edited November 15, 2012 by XIM Quote Link to comment Share on other sites More sharing options...
0 XIM Posted November 15, 2012 Author Report Share Posted November 15, 2012 Amigos sou eu denovo,tenho este script,tenho o produto cadastrado,me mostra que tem " Registros 1 a 1 de 1", mas não aparece nada só estes dizeres,se puderem me ajudar ficarei muito agradecido,um forte abraço a todos.<?php require_once('Connections/conexao.php'); ?><?php$currentPage = $_SERVER["PHP_SELF"];$maxRows_Recordset1 = 13;$pageNum_Recordset1 = 0;if (isset($_GET['pageNum_Recordset1'])) {$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];}$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;$colname_Recordset1 = "1";if (isset($_GET['cod_cat'])) {$colname_Recordset1 = (get_magic_quotes_gpc()) ? $_GET['cod_cat'] : addslashes($_GET['cod_cat']);}mysql_select_db($database_conexao, $conexao);$query_Recordset1 = sprintf("SELECT * FROM produtos WHERE cod_cat = %s", $colname_Recordset1);$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);$Recordset1 = mysql_query($query_limit_Recordset1, $conexao) or die(mysql_error());$row_Recordset1 = mysql_fetch_assoc($Recordset1);if (isset($_GET['totalRows_Recordset1'])) { $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];} else { $all_Recordset1 = mysql_query($query_Recordset1); $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);}$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;$queryString_Recordset1 = "";if (!empty($_SERVER['QUERY_STRING'])) { $params = explode("&", $_SERVER['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, "pageNum_Recordset1") == false && stristr($param, "totalRows_Recordset1") == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_Recordset1 = "&" . implode("&", $newParams); }}$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);?><script language=JavaScript" type="text/JavaScript"><!--function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features);}//--></script><div align="center"> <?php if ($totalRows_Recordset1 == 0) { // Show if recordset empty ?> No momento não dispomos de nenhum produto para essa categoria. <?php } // Show if recordset empty ?> <br> <?php do { ?> <?php if ($totalRows_Recordset1 > 0) { // Show if recordset not empty ?><?php$cont = "0"; //Define o valor da variávelecho "<table width=\"88%\" height=\"10\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>"; //Inicia a tabelawhile($row_Recordset1 = mysql_fetch_assoc($Recordset1)){ //Loop até encontrar o resultado desejado(talvez não seja isso que está escrito).if($cont == "4"){ //Se a variável possuir valor 3, fecha a linha atual e inicia outra linha(da tabela) e retorna o valor da variável para zero. echo "</tr><tr>"; $cont = "0";}echo "<td align=center ><img src='".$row_Recordset1['fot_peq]."' width='100' height='100' border='0'><br>";echo $row_Recordset1['nome_prod']."<br>";echo $row_Recordset1['descricao']."<br>";echo '<a href=detalhes.php?cod_prod='.$row_Recordset1['cod_prod].'">Ver Detalhes</a>';echo "</td>";$cont++;} ?> <?php } // Show if recordset not empty ?> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));mysql_free_result($Recordset1);?> <p> Registros <?php echo ($startRow_Recordset1 + 1) ?> a <?php echo min($startRow_Recordset1 + $maxRows_Recordset1, $totalRows_Recordset1) ?> de <?php echo $totalRows_Recordset1 ?> <table border="0" width="50%" align="center"> <tr> <td width="23%" align="center"> <?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?> <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, 0, $queryString_Recordset1); ?>">Primeiro</a> <?php } // Show if not first page ?> </td> <td width="31%" align="center"> <?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?> <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, max(0, $pageNum_Recordset1 - 1), $queryString_Recordset1); ?>">Retornar</a> <?php } // Show if not first page ?> </td> <td width="23%" align="center"> <?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?> <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); ?>">Avançar</a> <?php } // Show if not last page ?> </td> <td width="23%" align="center"> <?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?> <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, $totalPages_Recordset1, $queryString_Recordset1); ?>">Último</a> <?php } // Show if not last page ?> </td> </tr> </table></p> </div>resolvido amigos,foi só tirar o $row_Recordset1 = mysql_fetch_assoc($Recordset1); Quote Link to comment Share on other sites More sharing options...
Question
XIM
Amigos sou eu denovo,tenho este script,tenho o produto cadastrado,me mostra que tem " Registros 1 a 1 de 1", mas não aparece nada só estes dizeres,se puderem me ajudar ficarei muito agradecido,um forte abraço a todos.
<?php require_once('Connections/conexao.php'); ?>
<?php
$currentPage = $_SERVER["PHP_SELF"];
$maxRows_Recordset1 = 13;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
$colname_Recordset1 = "1";
if (isset($_GET['cod_cat'])) {
$colname_Recordset1 = (get_magic_quotes_gpc()) ? $_GET['cod_cat'] : addslashes($_GET['cod_cat']);
}
mysql_select_db($database_conexao, $conexao);
$query_Recordset1 = sprintf("SELECT * FROM produtos WHERE cod_cat = %s", $colname_Recordset1);
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $conexao) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
$queryString_Recordset1 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_Recordset1") == false &&
stristr($param, "totalRows_Recordset1") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_Recordset1 = "&" . implode("&", $newParams);
}
}
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);
?>
<script language=JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<div align="center">
<?php if ($totalRows_Recordset1 == 0) { // Show if recordset empty ?>
No momento não dispomos de nenhum produto para essa categoria.
<?php } // Show if recordset empty ?>
<br>
<?php do { ?>
<?php if ($totalRows_Recordset1 > 0) { // Show if recordset not empty ?>
<?php
$cont = "0"; //Define o valor da variável
echo "<table width=\"88%\" height=\"10\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>"; //Inicia a tabela
while($row_Recordset1 = mysql_fetch_assoc($Recordset1)){ //Loop até encontrar o resultado desejado(talvez não seja isso que está escrito).
if($cont == "4"){ //Se a variável possuir valor 3, fecha a linha atual e inicia outra linha(da tabela) e retorna o valor da variável para zero.
echo "</tr><tr>";
$cont = "0";}
echo "<td align=center ><img src='".$row_Recordset1['fot_peq]."' width='100' height='100' border='0'><br>";
echo $row_Recordset1['nome_prod']."<br>";
echo $row_Recordset1['descricao']."<br>";
echo '<a href=detalhes.php?cod_prod='.$row_Recordset1['cod_prod].'">Ver Detalhes</a>';
echo "</td>";
$cont++;
}
?>
<?php } // Show if recordset not empty ?>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
mysql_free_result($Recordset1);
?>
<p> Registros <?php echo ($startRow_Recordset1 + 1) ?> a <?php echo min($startRow_Recordset1 + $maxRows_Recordset1, $totalRows_Recordset1) ?> de <?php echo $totalRows_Recordset1 ?>
<table border="0" width="50%" align="center">
<tr>
<td width="23%" align="center"> <?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, 0, $queryString_Recordset1); ?>">Primeiro</a>
<?php } // Show if not first page ?> </td>
<td width="31%" align="center"> <?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, max(0, $pageNum_Recordset1 - 1), $queryString_Recordset1); ?>">Retornar</a>
<?php } // Show if not first page ?> </td>
<td width="23%" align="center"> <?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); ?>">Avançar</a>
<?php } // Show if not last page ?> </td>
<td width="23%" align="center"> <?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, $totalPages_Recordset1, $queryString_Recordset1); ?>">Último</a>
<?php } // Show if not last page ?> </td>
</tr>
</table></p>
</div>
Edited by XIMLink to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.