Foros del Web » Programando para Internet » PHP »

Limitar un Juego de Registros para no mostrar el ultimo registro

Estas en el tema de Limitar un Juego de Registros para no mostrar el ultimo registro en el foro de PHP en Foros del Web. Q tal, Tengo el siguiente juego de registros Código PHP: mysql_select_db ( $database_conn_mineria ,  $conn_mineria ); $query_rsNoticias  =  "SELECT n_fecha, n_head, n_foto_url, repo_news.n_body FROM repo_news WHERE n_columna = '1' AND repo_news.n_tipo_campo = '1' ORDER BY repo_news.ID_News_rep DESC" ; $rsNoticias  =  mysql_query ( $query_rsNoticias ...
  #1 (permalink)  
Antiguo 26/06/2006, 16:03
Avatar de cookie  
Fecha de Ingreso: agosto-2002
Mensajes: 688
Antigüedad: 21 años, 6 meses
Puntos: 0
Limitar un Juego de Registros para no mostrar el ultimo registro

Q tal,

Tengo el siguiente juego de registros

Código PHP:
mysql_select_db($database_conn_mineria$conn_mineria);
$query_rsNoticias "SELECT n_fecha, n_head, n_foto_url, repo_news.n_body FROM repo_news WHERE n_columna = '1' AND repo_news.n_tipo_campo = '1' ORDER BY repo_news.ID_News_rep DESC";
$rsNoticias mysql_query($query_rsNoticias$conn_mineria) or die(mysql_error());
$row_rsNoticias mysql_fetch_assoc($rsNoticias);
$totalRows_rsNoticias mysql_num_rows($rsNoticias); 
Me recomiendan algo para editar el juego de registros para que me muestre todos los registros EXCEPTO el ultimo?

Es decir que si me muestra

algo así :

3
2
1

solo me muestre

2
1


Alguna sugerencia?

Gracias ¡
__________________
___________________________

do the evolution ¡
Mineriaenlinea.com

Última edición por cookie; 27/06/2006 a las 11:15
  #2 (permalink)  
Antiguo 26/06/2006, 16:20
Avatar de DinamiteDog  
Fecha de Ingreso: febrero-2005
Ubicación: Rosario, Argentina
Mensajes: 77
Antigüedad: 19 años, 1 mes
Puntos: 4
y usando un Limit 0 , x

donde x es un num_rows - 1

fijate si te sirve
  #3 (permalink)  
Antiguo 27/06/2006, 11:35
Avatar de cookie  
Fecha de Ingreso: agosto-2002
Mensajes: 688
Antigüedad: 21 años, 6 meses
Puntos: 0
Mira este es un juego de registros donde muestro 10 registros en orden descendente

Código PHP:
<?php
$maxRows_rs_noti 
10;
$pageNum_rs_noti 0;
if (isset(
$_GET['pageNum_rs_noti'])) {
  
$pageNum_rs_noti $_GET['pageNum_rs_noti'];
}
$startRow_rs_noti $pageNum_rs_noti $maxRows_rs_noti;

mysql_select_db($database_conn_mineria$conn_mineria);
$query_rs_noti "SELECT repo_news.n_head FROM repo_news, fuentes WHERE n_columna = '1' AND repo_news.n_fuente = fuentes.fuentes_id AND repo_news.n_tipo_campo = '1' ORDER BY ID_News_rep DESC";
$query_limit_rs_noti sprintf("%s LIMIT %d, %d"$query_rs_noti$startRow_rs_noti$maxRows_rs_noti);
$rs_noti mysql_query($query_limit_rs_noti$conn_mineria) or die(mysql_error());
$row_rs_noti mysql_fetch_assoc($rs_noti);

if (isset(
$_GET['totalRows_rs_noti'])) {
  
$totalRows_rs_noti $_GET['totalRows_rs_noti'];
} else {
  
$all_rs_noti mysql_query($query_rs_noti);
  
$totalRows_rs_noti mysql_num_rows($all_rs_noti);
}
$totalPages_rs_noti ceil($totalRows_rs_noti/$maxRows_rs_noti)-1;
?>
en donde puedo aplicar lo q me dices?


Yo quiero que me muestre los 10 registro, EXCEPTO el mas reciente (considerando q esta ordenada la consulta en orden Descendente.

gracias
__________________
___________________________

do the evolution ¡
Mineriaenlinea.com
  #4 (permalink)  
Antiguo 27/06/2006, 15:36
Avatar de Nefertiter  
Fecha de Ingreso: enero-2003
Ubicación: Rosario
Mensajes: 1.316
Antigüedad: 21 años, 2 meses
Puntos: 9
CAMBIA ESTA LINEA

$startRow_rs_noti = $pageNum_rs_noti * $maxRows_rs_noti;

POR

$startRow_rs_noti = ($pageNum_rs_noti * $maxRows_rs_noti )+1;
  #5 (permalink)  
Antiguo 28/06/2006, 09:00
Avatar de cookie  
Fecha de Ingreso: agosto-2002
Mensajes: 688
Antigüedad: 21 años, 6 meses
Puntos: 0
Cita:
Iniciado por Nefertiter
CAMBIA ESTA LINEA

$startRow_rs_noti = $pageNum_rs_noti * $maxRows_rs_noti;

POR

$startRow_rs_noti = ($pageNum_rs_noti * $maxRows_rs_noti )+1;

Gracias ¡¡¡
__________________
___________________________

do the evolution ¡
Mineriaenlinea.com
  #6 (permalink)  
Antiguo 30/06/2006, 20:03
Avatar de Nefertiter  
Fecha de Ingreso: enero-2003
Ubicación: Rosario
Mensajes: 1.316
Antigüedad: 21 años, 2 meses
Puntos: 9
de nada ;)
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 06:14.