Io ho una tabella che stampa una riga per ogni utente, come questa:
codice:<?php $utente = $_SESSION['username']; $query = "SELECT id, user, nome, cognome FROM utenti WHERE user<>'" .$utente. "'"; $result = mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<tr> <td>$row[id]</td> <td>$row[user]</td> <td>$row[nome]</td> <td>$row[cognome]</td>"; //utenti non amici if(..qualcosa..) { echo "<td><input type=\"submit\" name=\"submit\" value=\"RICHIEDI AMICIZIA\"></td>"; } //utenti amici else if(..qualcosa..) { echo "<td><input type=\"submit\" name=\"submit\" value=\"RIMUOVI AMICIZIA\"></td>"; } //in attesa else { echo "<td><input type=\"submit\" name=\"submit\" value=\"IN ATTESA\"></td>"; } echo "</tr>"; } ?>
Quello che mi manca sono le condizioni dentro l'if, non so come farle.. :help:

Rispondi quotando