Godd
January 10th, 2010, 07:23 PM
I'm designing a commenting system for my website, and I'm getting
Parse error: syntax error, unexpected '}'
I've checked to see if all the curly brackets have a beginning and end. And they do. This would mean, to me, that there is something before the error that is making it seem as though the bracket is improperly placed. But as far as I can tell, the syntax for everything prior to it is peachy keen. But obviously, I have to be wrong in one of those assumptions. Ha.
if(!in_array($current_comm_array['cid'], $com_seq)){
#Not_r $$ no_r if($current_comm_array['cidr'] == "0" && $reply_commen_array['cidr'] != $current_comm_array['cid']){
#adds to sequence $seq_tmp = array( $next => $current_comm_array['cid'] );
$com_seq = array_merge($com_seq, $seq_tmp);
echo $main_cycle . "1";
$next++;
$main_cycle++; }
#Not_r $$ y_r elseif($current_comm_array['cidr'] == "0" && $reply_commen_array['cidr'] == $current_comm_array['cid']){
#adds to sequence $seq_tmp = array( $next => $current_comm_array['cid'] );
$com_seq = array_merge($com_seq, $seq_tmp);
$next++;
$main_cycle = $reply_commen_array['cid'];
#adds new tab lvl $tab_tmp = array( $next_tab => $current_comm_array['cid'] );
$tab_lvl = array_merge($tab_lvl, $tab_tmp);
$next_tab++;
#sets tab level $tab = end($tab_lvl);
}
#R $$ no_r elseif($current_comm_array['cidr'] != "0" && $reply_commen_array['cidr'] != $current_comm_array['cid']){
#adds to sequence $seq_tmp = array( $next => current_comm_array['cid'] );
$com_seq = array_merge($com_seq, $seq_tmp);
$next++;
$next_reply = mysql_fetch_array($reply_commen);
#chks if last reply if(!$next_reply){
$tab = prev($tab_lvl);
$main_cycle = $tab;
}
elseif($next_reply){
$main_cycle = $next_reply['cid'];
}
} <= ERROR
#R && y_r elseif($current_comm_array['cidr'] != "0" && $reply_commen_array['cidr'] == $current_comm_array['cid']){
#adds to sequence $seq_tmp = array( $next => $current_comm_array['cid'] );
$com_seq = array_merge($com_seq, $seq_tmp);
$next++;
$main_cycle = $reply_commen_array['cid'];
#adds a new tab lvl $tab_tmp = array( $next_tab => $current_comm_array['cid'] );
$tab_lvl = array_merge($tab_lvl, $tab_tmp);
$next_tab++;
$tab = end($tab_lvl);
}
}
I directly noted the location of the error.
Parse error: syntax error, unexpected '}'
I've checked to see if all the curly brackets have a beginning and end. And they do. This would mean, to me, that there is something before the error that is making it seem as though the bracket is improperly placed. But as far as I can tell, the syntax for everything prior to it is peachy keen. But obviously, I have to be wrong in one of those assumptions. Ha.
if(!in_array($current_comm_array['cid'], $com_seq)){
#Not_r $$ no_r if($current_comm_array['cidr'] == "0" && $reply_commen_array['cidr'] != $current_comm_array['cid']){
#adds to sequence $seq_tmp = array( $next => $current_comm_array['cid'] );
$com_seq = array_merge($com_seq, $seq_tmp);
echo $main_cycle . "1";
$next++;
$main_cycle++; }
#Not_r $$ y_r elseif($current_comm_array['cidr'] == "0" && $reply_commen_array['cidr'] == $current_comm_array['cid']){
#adds to sequence $seq_tmp = array( $next => $current_comm_array['cid'] );
$com_seq = array_merge($com_seq, $seq_tmp);
$next++;
$main_cycle = $reply_commen_array['cid'];
#adds new tab lvl $tab_tmp = array( $next_tab => $current_comm_array['cid'] );
$tab_lvl = array_merge($tab_lvl, $tab_tmp);
$next_tab++;
#sets tab level $tab = end($tab_lvl);
}
#R $$ no_r elseif($current_comm_array['cidr'] != "0" && $reply_commen_array['cidr'] != $current_comm_array['cid']){
#adds to sequence $seq_tmp = array( $next => current_comm_array['cid'] );
$com_seq = array_merge($com_seq, $seq_tmp);
$next++;
$next_reply = mysql_fetch_array($reply_commen);
#chks if last reply if(!$next_reply){
$tab = prev($tab_lvl);
$main_cycle = $tab;
}
elseif($next_reply){
$main_cycle = $next_reply['cid'];
}
} <= ERROR
#R && y_r elseif($current_comm_array['cidr'] != "0" && $reply_commen_array['cidr'] == $current_comm_array['cid']){
#adds to sequence $seq_tmp = array( $next => $current_comm_array['cid'] );
$com_seq = array_merge($com_seq, $seq_tmp);
$next++;
$main_cycle = $reply_commen_array['cid'];
#adds a new tab lvl $tab_tmp = array( $next_tab => $current_comm_array['cid'] );
$tab_lvl = array_merge($tab_lvl, $tab_tmp);
$next_tab++;
$tab = end($tab_lvl);
}
}
I directly noted the location of the error.