Hi,

Im trying to add an else option to a page to show that someone is not logged in.


Code:
			<?php
$query = mysql_query("SELECT * FROM users ORDER BY ID DESC LIMIT 1");
while($row = mysql_fetch_array($query)) {

	
	 if($query){
'<li>You are sucessfully logged in as <?php echo $row['id']; ?>.</li>' }
else($query){
'<li>You are currently not logged in.</li>'
	

}
}
?>

The following code works fine but Im trying to add the above else option. Can anyone please advise how I can make the else work.


Code:
			<?php
$query = mysql_query("SELECT * FROM users ORDER BY ID DESC LIMIT 1");
while($row = mysql_fetch_array($query)){
    ?> 

<li>You are sucessfully logged in as <?php echo $row['id']; ?>.</li> 

<?php
}
?>