Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    Utente di HTML.it
    Registrato dal
    Sep 2002
    Messaggi
    36

    voglio far vedere gli ultimi 5 record

    Salve ho un problema non riesco a far vedere solo gli ultimi 5 record inseriti nella tabella questo è il codice ma fa vedere tutta la tabella il campo oggi c'è la data.

    codice:
    $Righe = 0;
    $result1 = mysql_query("select artid, sezid, titolo, contenuto, image, image1, oggi from articoli order by oggi DESC");
    
    	if (mysql_num_rows($result1) > 0) {
    		echo "<table border=0 width=100% cellpadding=3 cellspacing=0>";
    		while(list($artid, $sezid, $titolo, $contenuto, $image, $image1, $oggi) = mysql_fetch_array($result1)) {
    			if ($Righe < 5) {	
    			$result2 = mysql_query("select sezname from sezioni where sezid=$sezid ");
    			list($sezname) = mysql_fetch_row($result2);
    				
    				echo "<tr><td valign=top width=15%>";
    				if ($image != ($path."vuoto.gif")){
    					if ($image1 != ($path."vuoto.gif")){
    					echo "<a href=\"$image1\"><img src=\"$image\" width=142 border=0></a></td></tr>";
    					}
    					else{
    					echo"<img src=\"$image\" border=0><td></tr>";
    					}
    				}
    				echo "<tr><td  class=tit width=85% valign=top>
    Comunicato del $oggi Italian time</td></tr>";
    				echo "<tr><td  class=tit width=85% valign=top>
    $titolo</td></tr>";
    				
    				echo "<tr><td align=right><a href=\"$image1\"><font size=2 face=Humanst521 BT><img border=0 src=../web2/images/biglia.jpg width=24 height=17></font></a>[/b]";
    				echo "<font face=Humanst521 BT size=2><a href=\"$image1\"> Scarica il file PDF</a></font></td></tr>";
    				echo "<tr><td align=right><font size=2 face=Humanst521 BT><img border=0 src=../web2/images/biglia.jpg width=24 height=17></font>";
    				echo "<font face=Humanst521 BT size=2> Invia il file per email</font></td></tr>";
    	$Righe + 1;		
    				}
    				
    			}
    			echo "</table>";
    		}
    	else{
    	}
    		echo "
    
    <b class=px14>[/b]";

    grazie per laiuto

  2. #2
    Utente di HTML.it L'avatar di gianiaz
    Registrato dal
    May 2001
    Messaggi
    8,027
    codice:
    select artid, sezid, titolo, contenuto, image, image1, oggi from articoli order by oggi DESC LIMIT 0,5

  3. #3
    Utente di HTML.it
    Registrato dal
    Sep 2002
    Messaggi
    36
    Grande funziona grazie mille!!

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.