Parse error: syntax error, unexpected $end ... on line 50

Hi, I have moved some code from working file to another to merge them but I am getting the error named in the title, I can’t find any missing } etc so I need a fresh set of eyes :frowning: the “on line 50” points to

[php]<?php
include_once(“php_includes/check_login_status.php”);
$sql = “SELECT username, avatar FROM users WHERE avatar IS NOT NULL AND activated=‘1’ ORDER BY RAND() LIMIT 32”;
$query = mysqli_query($db_conx, $sql);
$userlist = “”;
while ($row = mysqli_fetch_array($query, MYSQLI_ASSOC)) {
$u = $row[“username”];
$avatar = $row[“avatar”];
$profile_pic = ‘user/’.$u.’/’.$avatar;
$userlist .= ‘' .$u. '’;
}
$sql = “SELECT COUNT(id) FROM users WHERE activated=‘1’”;
$query = mysqli_query($db_conx, $sql);
$row = mysqli_fetch_array($query);
$usercount = $row[0];
$categorySQL = " select * from `categories ";
$categoryEXE = mysql_query($categorySQL);
$categoryROWS = mysql_num_rows($categoryEXE);

//if(isset($_POST[‘parent’]))
//{

$id = intval(@$_POST[‘parent’]);
if(isset($_SESSION[‘username’]))
{
//$dn1 = mysql_fetch_array(mysql_query(‘select count(c.id) as nb1, c.name from categories as c where c.id="’.$id.’"’));
$dn1[‘nb1’] = 1;
if($dn1[‘nb1’]>0)
{

?>

Topictalk <?php include_once("template_pageTop.php"); ?>

Currently <?php echo $usercount; ?> registered members.


<?php include_once("template_pageBottom.php"); ?> [/php]

there are no closing brackets for these two if statements:
[php]if(isset($_SESSION[‘username’]))
{
//$dn1 = mysql_fetch_array(mysql_query(‘select count(c.id) as nb1, c.name from categories as c where c.id="’.$id.’"’));
$dn1[‘nb1’] = 1;
if($dn1[‘nb1’]>0)
{
[/php]

I suggest you code in an IDE that will make these things obvious as you’re coding.
Red :wink:

Sponsor our Newsletter | Privacy Policy | Terms of Service