r34p3rex Posted July 24, 2007 Share Posted July 24, 2007 i'm getting this error everytime i run the page Parse error: parse error, unexpected '[' in /homepages/19/d176940355/htdocs/d176940355/status.php on line 314 heres the php snippet <?php mysql_select_db($database_db1, $db1); $rostertable = $row_teams['tablename']; $charteam = $row_characters['charname']; $query_ct = "SELECT * FROM `$rostertable` WHERE charname='$charteam' LIMIT 1"; $ct = mysql_query($query_ct, $db1) or die(mysql_error()); $row_ct = mysql_fetch_assoc($ct); $totalRows_ct = mysql_num_rows($ct); if($row_ct['onroster'] == "1") { echo "<font color='#FF0000'>On Roster</font>"; } if($row_ct['onroster'] == "0") { if(row_ct['team'] == "team1") { mysql_select_db($database_db1, $db1); $query_onteam = "SELECT * FROM guildwars ORDER by gwID DESC LIMIT 1"; $onteam = mysql_query($query_onteam, $db1) or die(mysql_error()); $row_onteam = mysql_fetch_assoc($onteam); $totalRows_onteam = mysql_num_rows($onteam); echo "<font color='#0099FF'>"; echo $row_onteam['team1']; echo "</font>"; } if(row_ct['team'] == "team2") { mysql_select_db($database_db1, $db1); $query_onteam = "SELECT * FROM guildwars ORDER by gwID DESC LIMIT 1"; $onteam = mysql_query($query_onteam, $db1) or die(mysql_error()); $row_onteam = mysql_fetch_assoc($onteam); $totalRows_onteam = mysql_num_rows($onteam); echo "<font color='#00FF66'>"; echo $row_onteam['team2']; echo "</font>"; } } else if(totalRows_ct == "0") { echo "<font color='CC0033'>Not Registered</font>"; } ?> line 314 refers to this line if($row_ct['onroster'] == "0") { >>>>>>>>. if(row_ct['team'] == "team1") { mysql_select_db($database_db1, $db1); $query_onteam = "SELECT * FROM guildwars ORDER by gwID DESC LIMIT 1"; $onteam = mysql_query($query_onteam, $db1) or die(mysql_error()); $row_onteam = mysql_fetch_assoc($onteam); Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted July 24, 2007 Share Posted July 24, 2007 row_ct needs a $ in front of it you can do text to text compare in an If (its pointless but you can) i.e <?php if("yes" == "yes") //always true if("yes" == "no") //Always false ?> Quote Link to comment Share on other sites More sharing options...
r34p3rex Posted July 24, 2007 Author Share Posted July 24, 2007 omg thanks! LMAO i spent 2 hours staring at those two lines and didn't see whats wrong with it T_T no more writing code for 10 hours straight for me x.x Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted July 24, 2007 Share Posted July 24, 2007 try using a pretty print text editor (not advertising, but i use notepad++ and it works pretty good) that way it will color variables/strings/blocks for you so you can see these sorts of errors very easily because the colors will not make sense Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.