Help with Variable error in PHP

pokefan2

New Member
Messages
24
Reaction score
0
Points
0
The Error is

Parse error: syntax error, unexpected T_VARIABLE in /home/pokefan0/public_html/pokefan0_wolfmagic/info.php on line 18

I have no clue how to fix this.

Here is my code.

16. mysql_query("UPDATE players SET lastlogin='$lastlogin' WHERE id='$sessid' LIMIT 1" ) or die(mysql_error())
17.
18.$query = mysql_query("SELECT * FROM players WHERE id='$sessid' LIMIT 1") or die(mysql_error());
 

Salvatos

Member
Prime Account
Messages
562
Reaction score
1
Points
18
16. mysql_query("UPDATE players SET lastlogin='$lastlogin' WHERE id='$sessid' LIMIT 1") or die(mysql_error());

Unexpected T_VARIABLE means a variable is stated when it shouldn't, usually meaning something just before has not been closed.
 
Last edited:

phpasks

New Member
Messages
145
Reaction score
0
Points
0
You query here
mysql_query("UPDATE players SET lastlogin='$lastlogin' WHERE id='$sessid' LIMIT 1" )



You can use below query try it
mysql_query("UPDATE players SET lastlogin='$lastlogin' WHERE id='$sessid'" )
// Limit 1 is not in update query that's for error
 

scopey

New Member
Messages
62
Reaction score
0
Points
0
The LIMIT part of the query is fine, and good practice. The problem is a semi-colon you have missed at the end of line 16.
 
Top