Visualizzazione dei risultati da 1 a 3 su 3

Discussione: while....exit()

  1. #1

    while....exit()

    ciao

    ho dei dati in un db, sul sito devo stampare solo 5 risultati (anke se nel db ne ho inseriti di piu)

    ho provato cosi...

    $count=1;
    while($row_price = mysql_fetch_array($res_price))
    {
    $inizio = reverseDate($row_price[0]);
    $fine = reverseDate($row_price[1]);
    $min = ereg_replace ( '\.', ',', $row_price[2]);
    $max = ereg_replace ( '\.', ',', $row_price[3]);

    if ($min=="0.00") $price=$max;
    if ($max=="0.00") $price=$min;

    $tab_price .="<td ".$style.">";
    $tab_price .="<table cellspacing=0 cellpadding=0 width=100% border=0>";
    $tab_price .="<tr>";
    $tab_price .="<td ".$title_table.">dal: ".$count.$inizio."
    a ".$fine."</td>";
    $tab_price .="</tr>";
    $tab_price .="<tr>";
    $tab_price .="<td ".$price_table.">";
    if ($price) $tab_price .=" € ".$price; else $tab_price .="min € ".$min."
    max € ".$max;
    $tab_price .="</td>";
    $tab_price .="</tr>";
    $tab_price .="</table>";
    $tab_price .="</td>";

    $count++;
    if ($count==6)
    {
    exit("pippo");
    }


    ma non esce dal ciclo...cioe' non mostra nenahce i 5 risultati salta subito all'exit...come mai?
    http://www.mcganass.com

  2. #2
    non basta mettere alla fine della query LIMIT 0, 5 ?
    debian:~$ uname -r
    2.6.18-1-686
    debian:~$

    Il quiz manager è nato!!! visitate http://shenk.altervista.org !!

  3. #3
    la soluzione piu' semplice e' sempre dietro l'angolo

    sono cotto grazie
    http://www.mcganass.com

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.