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
Share on other sites

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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.