Phpfr3ak Posted October 8, 2010 Share Posted October 8, 2010 I don't see what the heck it could be. kind of lost anyone provide a hand please? Parse error, unexpected T_STRING on line 11, but I don't see it Parse error: syntax error, unexpected T_STRING in C:\Program Files\EasyPHP-5.3.3\www\htdocs\leavecrew.php on line 11 <?php$CrewID = mysql_real_escape_string($_GET['CrewID']); UPDATE users SET $up = "DELETE FROM player_crews WHERE id = $playerID"; mysql_query($up) or die(mysql_error()); $up = "UPDATE crews SET members = members - 1 WHERE id = $CrewID"; mysql_query($up) or die(mysql_error()); $up = "UPDATE users SET in_crew = 0 WHERE id = $playerID"; mysql_query($up) or die(mysql_error()); echo "You have successfully left this crew."; } else { echo "Error"; } }?> Link to comment https://forums.phpfreaks.com/topic/215386-parse-error/ Share on other sites More sharing options...
joel24 Posted October 8, 2010 Share Posted October 8, 2010 what is UPDATE users SET doing there? if it is a comment, comment it out like so //UPDATE users SET if it is a part of an SQL query put it inside a query. and then the closing bracket on line 13 } - where is the opening bracket? Post the entire code Link to comment https://forums.phpfreaks.com/topic/215386-parse-error/#findComment-1120042 Share on other sites More sharing options...
Phpfr3ak Posted October 8, 2010 Author Share Posted October 8, 2010 The full code is below, i didn't notice i hadn't removed the users part thanks for pointing it out... now get the error varse error: syntax error, unexpected '}' in C:\Program Files\EasyPHP-5.3.3\www\htdocs\leavecrew.php on line 18, dont see why :s <?php include("header.php"); ?> <td width="375" height="586" valign="top" colspan="2" bgcolor="#1a2940" align="center" style="border-bottom:thin #FFF solid;"> <br /> <br /><?php$CrewID = mysql_real_escape_string($_GET['CrewID']); $up = "DELETE FROM player_crews WHERE id = $playerID"; mysql_query($up) or die(mysql_error()); $up = "UPDATE crews SET members = members - 1 WHERE id = $CrewID"; mysql_query($up) or die(mysql_error()); $up = "UPDATE users SET in_crew = 0 WHERE id = $playerID"; mysql_query($up) or die(mysql_error()); echo "You have successfully left this crew."; } else { echo "Error";?></td> <?php include("footer.php"); ?> Link to comment https://forums.phpfreaks.com/topic/215386-parse-error/#findComment-1120043 Share on other sites More sharing options...
marcus Posted October 8, 2010 Share Posted October 8, 2010 Are you sure that's the whole code? Seems to me there's some conditional statement we can't see. Are there statements in header.php? You're closing a statement when a statement hasn't even been called. Link to comment https://forums.phpfreaks.com/topic/215386-parse-error/#findComment-1120060 Share on other sites More sharing options...
Phpfr3ak Posted October 8, 2010 Author Share Posted October 8, 2010 The statements are in header.php yea, they work with other pages so its something on this page for sure not the header Link to comment https://forums.phpfreaks.com/topic/215386-parse-error/#findComment-1120244 Share on other sites More sharing options...
Pikachu2000 Posted October 8, 2010 Share Posted October 8, 2010 Post the header.php file as well, since it has the open if() conditional that corresponds to the else{} in this script. Link to comment https://forums.phpfreaks.com/topic/215386-parse-error/#findComment-1120258 Share on other sites More sharing options...
Phpfr3ak Posted October 8, 2010 Author Share Posted October 8, 2010 From header <?php require_once('check.php'); $username = $_SESSION['username']; require_once('server.php'); require_once('stats.php'); $admin = $crewed = $playerdata['admin']; //SET OTHER PLAYERS ID $ID = mysql_real_escape_string($_GET['id']); //Get player data for current player $query = mysql_query("SELECT * FROM users WHERE username = '$username'"); $result = mysql_fetch_array($query); $playerID = $result['id']; $query = mysql_query("SELECT * FROM users WHERE id = '$playerID'"); $playerdata = mysql_fetch_array($query); //end current player data //if NO ID IS SET, MAKE OTHER USERS ID OUR ID if($ID == ""){ $ID = $playerID; } //data if viewing another profile $query = mysql_query("SELECT * FROM users WHERE id = '$ID'"); $data2 = mysql_fetch_array($query) or die(mysql_error()); $CrewID = $res['crew_id']; //end other users data //crew_data $crewed = $playerdata['in_crew']; if($crewed == 1){ //get crew name and id $sql = "SELECT * FROM player_crews WHERE player_id = $playerID"; $que = mysql_query($sql) or die(mysql_error()); $res = mysql_fetch_array($que); $CrewID = $res['crew_id']; $sql = "SELECT name FROM crews WHERE id = $CrewID"; $que = mysql_query($sql) or die(mysql_error()); $res = mysql_fetch_array($que); $cname = $res['name']; } ?> Link to comment https://forums.phpfreaks.com/topic/215386-parse-error/#findComment-1120286 Share on other sites More sharing options...
Pikachu2000 Posted October 8, 2010 Share Posted October 8, 2010 What is this supposed to do? What is it's purpose in the context of that script? In any event, it's causing the error. else { echo "Error"; Link to comment https://forums.phpfreaks.com/topic/215386-parse-error/#findComment-1120291 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.