Jump to content
MakeWebGames

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING


Daron

Recommended Posts

Hey i was working on modifying a one click attack system and i fixed alot of the errors myself but i just cannot fix this error

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/kaname/public_html/attack2.php on line 262

here is the code starting from line 262

   $result = mysql_query("UPDATE users SET hp = $r['hp'] WHERE userid=$r['userid']", $c) or die(mysql_error());
  $result = mysql_query("UPDATE users SET hp = $ir['hp'] WHERE userid=$userid", $c) or die(mysql_error());
  echo "</td></tr>";
?>
Link to comment
Share on other sites

Hey i was working on modifying a one click attack system and i fixed alot of the errors myself but i just cannot fix this error

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/kaname/public_html/attack2.php on line 262

here is the code starting from line 262

   $result = mysql_query("UPDATE users SET hp = $r['hp'] WHERE userid=$r['userid']", $c) or die(mysql_error());
  $result = mysql_query("UPDATE users SET hp = $ir['hp'] WHERE userid=$userid", $c) or die(mysql_error());
  echo "</td></tr>";
?>

Post the code from lines 252 - 272

Link to comment
Share on other sites

this is lines 250-265

if ($db->num_rows($warq) > 0)
{
$war=$db->fetch_row($warq);
$db->query("UPDATE squads SET squadPOINTS=squadPOINTS+1 WHERE squadID={$r['squad']}");
$db->query("UPDATE squads SET squadPOINTS=squadPOINTS-1 WHERE squadID={$ir['squad']}");
}
                echo "<center><font color=white>You need to train harder.You were defeated.</center>";

  }
  }

  //UPDATE USERS 
  $result = mysql_query("UPDATE users SET hp = $r['hp'] WHERE userid=$r['userid']", $c) or die(mysql_error());
  $result = mysql_query("UPDATE users SET hp = $ir['hp'] WHERE userid=$userid", $c) or die(mysql_error());
  echo "</td></tr>";
?>
Edited by Daron
Link to comment
Share on other sites

On line 262 and 263

replace

$result = mysql_query("UPDATE users SET hp = $r['hp'] WHERE userid=$r['userid']", $c) or die(mysql_error());

$result = mysql_query("UPDATE users SET hp = $ir['hp'] WHERE userid=$userid", $c) or die(mysql_error());

with

$result = mysql_query("UPDATE users SET hp = {$r['hp']} WHERE userid={$r['userid']}", $c) or die(mysql_error());

$result = mysql_query("UPDATE users SET hp = {$ir['hp']} WHERE userid={$userid}", $c) or die(mysql_error());

hope it works

Link to comment
Share on other sites

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.   Paste as plain text instead

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