Jump to content

unexpected else


Dracolas

Recommended Posts

if ($crank <= 4){

echo  "<Select name='player1'>";
}

$result = mysql_query("SELECT * FROM users order by rank");
while($row = mysql_fetch_assoc($result)){
$name = $row['username'];
echo "<option value='$name'>$name</option>"
}

echo "</select>";

else{
echo('Sorry, only Corporals or above may Recruit at this time');
echo('<br><a href="console.php">Back To Console</a>');
}

include("footer.php");
?>

 

Try that.

Link to comment
https://forums.phpfreaks.com/topic/188363-unexpected-else/#findComment-994383
Share on other sites

if ($crank <= 4) {
?>
Player 1: 
<Select name='player1'>
<?php
$result = mysql_query("SELECT * FROM users order by rank");
while($row = mysql_fetch_assoc($result)){
	$name = $row['username'];
	echo "<option value='$name'>$name</option>";
}
?>
</select>
<?php
} else {
echo('Sorry, only Corporals or above may Recruit at this time');
echo('<br><a href="console.php">Back To Console</a>');
}
include("footer.php");

Link to comment
https://forums.phpfreaks.com/topic/188363-unexpected-else/#findComment-994397
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.