Jump to content

Parse error


Phpfr3ak

Recommended Posts

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.