I get this error: Parse error: syntax error, unexpected $end in /home/a1633717/public_html/members.php on line 59 When I checked the code, I couldn’t find any error. Here is the code:
<?php
session_start();
require 'database.php';
$nuser=$_SESSION['user'];
$auser=$_SESSION['admin'];
if($nuser){
$userfinal=$nuser;
} elseif($auser) {
$userfinal=$auser;
}
if(isset($userfinal)) {
$Members = mysql_query("SELECT user FROM characters WHERE level ='1' ORDER BY exp
DESC") or die(mysql_error());
$numRowsMembers = mysql_num_rows($Members);
?>
<table border="0">
<?php
for($count = 1; $count <= $numRowsMembers; $count++)
{
$name = mysql_fetch_array($Members);
?>
<tr>
<?php
echo '<td><a href="member_profile.php?username=' . $name['user'] . '">' . name['user'] . '</a></td>';
?>
</tr>
<?php
}
?>
</table>
The error is at the bottom, and when I looked at it I did’t see an error. How can I fix that? I changed the order of and the php but nothing. Thanks in advance
This usually means you forgot to close a bracket, in this case, you forgot to close the if:
if(isset($userfinal)){Just add another closure bracket where you need it (probably after the last closure bracket so: