Kiira (Normal User)
Newbie
Messaggi: 2
Iscritto: 19/09/2013
|
Salve a tutti
Ho creato questo script:
<?php
include("config/require.php");
include("public/templates/header.php");
?>
<div id='container'>
<div id='main-content'>
<?php
$q = "SELECT * FROM contacts ORDER BY created_at DESC";
$r = mysql_query($q);
if(mysql_num_rows($r)>0):
?>
<h4>Recente</h4>
<?php
while($row = mysql_fetch_assoc($r)):
?>
<table class='contact'>
<tr>
<td width=161 height=122><img src='public/images/user.png'/></td>
<td style='text-align:left;'><?php echo "Sesso: "; ?> <?php echo $row["Sesso"];?>
<br/><?php echo "Anni: "; ?> <?php echo $row["Anni"]; ?>
<br/><?php echo "Messaggio: "; ?> <?php echo $row["Messaggio"]; ?>
<a href='javascript:;' class='action view-details' id='<?php echo $row["contact_id"]; ?>'>(Visualizza Tutto)</a></td>
</tr>
</table>
<?php
endwhile;//end while for looping non-empty result set.
elseif(mysql_num_rows()==0)://nothing in the database
?>
<div class='welcome-bg'>
Benvenuto<br/>
<a href='javascript:showPage("add");' class='add_button' style='margin:auto;'></a>
</div>
<?php
endif;
?>
</div>
</div>
</body>
</html>
Estrae dal database dei dati e visualizza l'immagine user.png(<td width=161 height=122><img src='public/images/user.png'/></td>
Vorrei fare una verifica, se il sesso che estrae č Uomo lascia questa img, se č donna visualizza user2.png, come posso fare?
Grazie in anticipo
|