netman182 Posted February 15, 2010 Share Posted February 15, 2010 Can someone help me with this error PHP Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING the problem line of code is the following: $sql="SELECT players.first, players.last, players.address, players.city, players.postal, players.phone, players.feet, players.inch, players.yyyy, teams.teamname, teams.church, teams.division FROM players, teams WHERE players.teamid = '$_SESSION['teamid']' AND teams.teamid = '$_SESSION['teamid']'"; what is causing the error? Quote Link to comment Share on other sites More sharing options...
Psycho Posted February 15, 2010 Share Posted February 15, 2010 When you have a PHP parse error, the line number given is not always the line where the error occurs. It is the line where it can no longer interpret the code in the context given. The line you provided shouldn't cause a PHP error - but it might produce a MySQL error. Post 5-10 lines of code before that line. Most likely you have brackets or quote marks that did not start/end properly. Also, I would change that line above to this: $sql="SELECT players.first, players.last, players.address, players.city, players.postal, players.phone, players.feet, players.inch, players.yyyy, teams.teamname, teams.church, teams.division FROM players, teams WHERE players.teamid = '{$_SESSION['teamid']}' AND teams.teamid = '{$_SESSION['teamid']}'"; Notice th brackets around the variables. I would do that since you have the variables (which have single quotes) enclosed in single quotes as well. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.