Forum Moderators: coopster

Message Too Old, No Replies

PHP Parse Errors

Message Board Problems

         

jdellaro

3:02 pm on May 28, 2003 (gmt 0)

10+ Year Member



Friend of mine runs a message board right now. We loaded up today and were having some problems. The error messages are as follows:

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /web/arwen8/public_html/forum/Sources/BoardIndex.php on line 221

Fatal error: Call to undefined function: boardindex() in /web/arwen8/public_html/forum/index.php on line 329

Any suggestions on where to start looking for a possible mistake? If any other information is needed, I'd be happy to provide it. Just don't know what anyone who can help may need to see from the scripts, etc. Again, I'll do my best to give any other information to get this fixed. Thanks so much.

jatar_k

3:38 pm on May 28, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld jdellaro,

How about we start by what is on line 221. It sounds like a syntax error, missing $ or something. Fix the first one and then move on afterwards to line 329.

jdellaro

3:50 pm on May 28, 2003 (gmt 0)

10+ Year Member



Thanks for the welcome. I was reading through the threads and it seemed like so many people got the problems fixed here, that this would be the place to go.

Okay, Line 221 (including comment lines) reads:

list ($latestPostName,$latestPostID,$latestPostTime,$subject,$topicID,$numReplies,

line 222:

$latestPostRealName) = mysql_fetch_row($result3);

jatar_k

4:05 pm on May 28, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



have you tried putting it all on one line? Have you looked at the line before to see if that is the problem?

dreamcatcher

4:38 pm on May 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Did you copy and paste the code, because I notice a ) in the wrong place:

$latestPostRealName) = mysql_fetch_row($result3);

should be:

$latestPostRealName = mysql_fetch_row($result3);

jdellaro

12:10 am on May 29, 2003 (gmt 0)

10+ Year Member



Copy and pasted the code directly, but why would that second parentheses be out of place? Doesn't it close off the parentheses from the line before?

I deleted to pull line 221 and 222 together, and now here's those lines as well as a few lines preceding it, in case the problem may be located there.

$result3 = mysql_query("SELECT m.posterName,m.ID_MEMBER,m.posterTime,m.subject,t.ID_TOPIC,t.numReplies, mem.realName FROM {$db_prefix}topics as t LEFT JOIN {$db_prefix}messages as m ON (m.ID_MSG=t.ID_LAST_MSG) LEFT JOIN {$db_prefix}members as mem USING (ID_MEMBER) WHERE (t.ID_BOARD=$row_board[ID_BOARD]) ORDER BY m.posterTime DESC LIMIT 1");
if (mysql_num_rows($result3) > 0) {
list ($latestPostName,$latestPostID,$latestPostTime,$subject,$topicID,$numReplies,$latestPostRealName) = mysql_fetch_row($result3);

jatar_k

1:46 am on May 29, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I assume that putting 221 and 222 on the same line didn't help? Still same error on same line?

Have you tried building the query in a var and then pasing the var to mysql_query to see if the error switches lines?

Asandir

2:04 am on May 29, 2003 (gmt 0)

10+ Year Member



Try this code in place (which is doing what jatar_k sugested):

$result3sql = "SELECT m.posterName,m.ID_MEMBER,m.posterTime,m.subject,t.ID_TOPIC,t.numReplies, mem.realName FROM {$db_prefix}topics as t LEFT JOIN {$db_prefix}messages as m ON (m.ID_MSG=t.ID_LAST_MSG) LEFT JOIN {$db_prefix}members as mem USING (ID_MEMBER) WHERE (t.ID_BOARD=$row_board[ID_BOARD]) ORDER BY m.posterTime DESC LIMIT 1";
$result3 = mysql_query($result3sql);
if (mysql_num_rows($result3) > 0) {
list ($latestPostName,$latestPostID,$latestPostTime,$subject,$topicID,$numReplies,$latestPostRealName) = mysql_fetch_row($result3);

And then if that gives errors, look at which line it is... where the sql string is built, or somewhere else....

Also, that error further down the line will resolve when the first is resolved, by the looks of it.

jdellaro

2:14 am on May 29, 2003 (gmt 0)

10+ Year Member



Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /web/arwen8/public_html/forum/Sources/BoardIndex.php on line 222

I replaced the code with the code that asandir gave me, and that's what it came up with. So it pushed the line down one, it seems.

Asandir

3:22 am on May 29, 2003 (gmt 0)

10+ Year Member



Is it from a popular discussion board? Or a custom one?

jdellaro

3:33 am on May 29, 2003 (gmt 0)

10+ Year Member



I believe it was customized a bit. There is copyright information amongst the comments at the top though, seems like the majority of it was a pre-written board script.

Asandir

3:41 am on May 29, 2003 (gmt 0)

10+ Year Member



Which one?

It's spitting the dummy on that list() = mysql_fetch_array call, but that error is commonly because there's no ";" finishing the previous line of code.

Are you able to post the code for the complete if statement? Or a skeleton version? It might be failing on the case where there isn't >0 rows, and that;s where the problem could be....

dreamcatcher

3:24 pm on May 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Copy and pasted the code directly, but why would that second parentheses be out of place? Doesn't it close off the parentheses from the line before?

Yep,sorry about that. Looking at the code with only one eye open.

:)

jdellaro

3:49 pm on May 29, 2003 (gmt 0)

10+ Year Member



Got that portion of it working properly now. It seems the latest problem is that the skeleton of the forums has been corrupted, so we've got to reload what the separate forums were. Thanks everyone for the huge help, really appreciate it. :--)