Visualizzazione dei risultati da 1 a 4 su 4

Discussione: Errore con While

  1. #1

    Errore con While

    Ciao a tutti!
    Io ho una cosa del genere:

    Codice PHP:
    $query "SELECT ID,Nick,Testo,Polis,Data,Mittente FROM  posta  WHERE Nick='$wer[Nick]'  OR Polis='$wer[Polis]' ORDER BY `Data` DESC";
    $result mysql_query($query$db);
    while (
    $row mysql_fetch_array($result)) {
    //
    $query "SELECT * FROM  pgu  WHERE Nick='$row[Mittente]'";
    $result mysql_query($query$db);
    $sim mysql_fetch_array($result);
    //
    echo "<tr><TD width=100 valign='top'>[url='/scheda/scheda2.php?Nick=$row[Mittente]'] [b]<font color='green'>$row[Mittente]</font>[/b][/url][b] [img]/img/$sim[Simbolo][/img] 
    <font size='2'>
    $row[Data]</font>[/b]</td><TD width=500 bgcolor='white'>[b]$row[Testo][/b]</td><TD width=110><font color='green'>[b][url='rispondi.php?Nick=$row[Mittente]']Rispondi[/url]

    [url='cancella_messaggio.php?ID=
    $row[ID]']Cancella[/url]</font>[/b]</td></tr>";  } 
    come mai quando inserisco quel pezzetto tra gli slash, mi visualizza un risultato del while ($row = mysql_fetch_array($result)) {
    ??

    grazie per l'aiuto
    http://codecanyon.net/category/all?ref=Manuelandro
    And I bet she told a million people that she'd stay in touch, Well all the little promises they dont mean much,When theres
    memories to be made

  2. #2
    E' qua che utilizzi due volte $result
    codice:
    $result = mysql_query($query, $db);
    e all'interno del while si sovrascrive


    Ciao
    In a world without walls and fences - who needs windows and gates ?

  3. #3
    ma se non metto $result la query è come se non esistesse proprio! Non va!
    http://codecanyon.net/category/all?ref=Manuelandro
    And I bet she told a million people that she'd stay in touch, Well all the little promises they dont mean much,When theres
    memories to be made

  4. #4
    Prova così

    codice:
    $query = "SELECT ID,Nick,Testo,Polis,Data,Mittente FROM  posta  WHERE Nick='$wer[Nick]'  OR Polis='$wer[Polis]' ORDER BY `Data` DESC";
    
    $result = mysql_query($query, $db);
    
    while ($row = mysql_fetch_array($result)) {
    
    
    
    $query = "SELECT * FROM  pgu  WHERE Nick='$row[Mittente]'";
    
    $result_altro = mysql_query($query, $db);
    
    $sim = mysql_fetch_array($result_altro);
    
    
    
    echo "<tr><TD width=100 valign='top'> <font color='green'>$row[Mittente]</font> [img]/img/$sim[Simbolo][/img] 
    <font size='2'>$row[Data]</font></td><TD width=500 bgcolor='white'>$row[Testo]</td><TD width=110><font color='green'>Rispondi
    
    Cancella</font></td></tr>";  }
    In a world without walls and fences - who needs windows and gates ?

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 © 2024 vBulletin Solutions, Inc. All rights reserved.