Visualizzazione dei risultati da 1 a 3 su 3

Discussione: if in while

  1. #1

    if in while

    Codice PHP:
     while ($results mysql_fetch_array($query_limit)){ 

    if (
    file_exists("/var/www/test/shambala/avatar/$results['id']--immagine.jpg")) {echo "<td class=\"red\">$results['id']--immagine.jpg</td>";} 
    else {echo 
    "<td class=\"red\">$results['id']--immagine.jpg</td>";} 

    echo 
    "
    <td class=\"red\">" 
    .$results['nickname']. "</td>

    </tr>"
    ;}

    echo 
    "</table>"
    come faccio a inserire in un while un if?

    così non mi va...

  2. #2
    hai scritto bene il codice

    while( condizione ){
    if( condizione ){......} else {.....}
    }

    che errore ti dà?

  3. #3
    se ti da un parse error e' qui

    echo "<td class=\"red\">". $results['id']."--immagine.jpg</td>";}
    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.