Jump to content

Getting a T_VARIABLE error...


leerik

Recommended Posts

I know I should be looking for a missing semicolon here or something, but I just can't seem to find where my syntax is wrong. My error message is this...

Parse error: syntax error, unexpected T_VARIABLE in /home/www/s3/spy1u674/html/LA4squarestats/admin/roundscourts_teams.php on line 213

And here's my code (the last line with the bracket is line 213)


if($teams == "1")
{
  $player0team = $_POST['player0team'];
 
  //determining if player 0 already has stats listed for this match/round/court

  $player0_team_modifyoradd = mysql_query("SELECT LA4square_team_stats.TStatsPlayerNum AS teamplayerid
  FROM LA4square_team_stats
  WHERE LA4square_team_stats.TStatsPlayerNum = '$player0num' AND
  LA4square_team_stats.TStatsTeamID = '$player0team' AND
  LA4square_team_stats.TStatsSeasonID = '$season_id' AND
  LA4square_team_stats.TStatsMatchID = '$matchid' AND
  LA4square_team_stats.TStatsMatchRound = '$rounds_select' AND
  LA4square_team_stats.TStatsMatchCourt = '$courts_select'", $connection)
  or die(mysql_error());



  if(mysql_num_rows($player0_team_modifyoradd) == 0)
        {



Any help? Thanks!
Link to comment
Share on other sites

You never ended the first if statement

[code]

        if($teams == "1")
        {
            $player0team = $_POST['player0team'];
           
          //determining if player 0 already has stats listed for this match/round/court
       
          $player0_team_modifyoradd = mysql_query("SELECT LA4square_team_stats.TStatsPlayerNum AS teamplayerid
          FROM LA4square_team_stats
          WHERE LA4square_team_stats.TStatsPlayerNum = '$player0num' AND
          LA4square_team_stats.TStatsTeamID = '$player0team' AND
          LA4square_team_stats.TStatsSeasonID = '$season_id' AND
          LA4square_team_stats.TStatsMatchID = '$matchid' AND
          LA4square_team_stats.TStatsMatchRound = '$rounds_select' AND
          LA4square_team_stats.TStatsMatchCourt = '$courts_select'", $connection)
          or die(mysql_error());

        }

          if(mysql_num_rows($player0_team_modifyoradd) == 0)
        {
[/code]
Link to comment
Share on other sites

The whole code looks fine

[code]
        if($teams == 1)
        {
            $player0team = $_POST['player0team'];
           
          //determining if player 0 already has stats listed for this match/round/court
       
          $player0_team_modifyoradd = mysql_query("SELECT LA4square_team_stats.TStatsPlayerNum AS teamplayerid
          FROM LA4square_team_stats
          WHERE LA4square_team_stats.TStatsPlayerNum = $player0num AND
          LA4square_team_stats.TStatsTeamID = $player0team AND
          LA4square_team_stats.TStatsSeasonID = $season_id AND
          LA4square_team_stats.TStatsMatchID = $matchid AND
          LA4square_team_stats.TStatsMatchRound = '$rounds_select' AND
          LA4square_team_stats.TStatsMatchCourt = '$courts_select'", $connection) or die(mysql_error());



          if(mysql_num_rows($player0_team_modifyoradd) == 0)
        {
[/code]
Link to comment
Share on other sites

All right, here's a bunch of code for ya... The line in question is right after "if(mysql_num_rows($player0_team_modifyoradd) == 0)"

I'll try putting the SQL statement on one line, but as you can see, i've done a lot of them on seperate lines that seem to work fine...

}
else
{

//if the player _does_ have stats for this m/r/c, then update them

if($player0points != "")
{
mysql_query("UPDATE LA4square_points SET
PointsAmount = '$player0points'
WHERE PointsPlayerNumber = '$player0num' AND
PointsMatchCourt = '$courts_select' AND
PointsMatchRound = '$rounds_select' AND
PointsMatchID = '$matchid' AND
PointsSeasonID = '$season_id'", $connection)
or die(mysql_error());
}

if($player0entries != "")
{
mysql_query("UPDATE LA4square_entries SET
EntriesAmount = '$player0entries'
WHERE EntriesPlayerNumber = '$player0num' AND
EntriesMatchCourt = '$courts_select' AND
EntriesMatchRound = '$rounds_select' AND
EntriesMatchID = '$matchid' AND
EntriesSeasonID = '$season_id'", $connection)
or die(mysql_error());
}

if($player0aces != "")
{
mysql_query("UPDATE LA4square_aces SET
AcesAmount = '$player0aces'
WHERE AcesPlayerNumber = '$player0num' AND
AcesMatchCourt = '$courts_select' AND
AcesMatchRound = '$rounds_select' AND
AcesMatchID = '$matchid' AND
AcesSeasonID = '$season_id'", $connection)
or die(mysql_error());
}

if($player0bodysacs != "")
{
mysql_query("UPDATE LA4square_bodysacs SET
BodySacsAmount = '$player0bodysacs'
WHERE BodySacsPlayerNumber = '$player0num' AND
BodySacsMatchCourt = '$courts_select' AND
BodySacsMatchRound = '$rounds_select' AND
BodySacsMatchID = '$matchid' AND
BodySacsSeasonID = '$season_id'", $connection)
or die(mysql_error());
}

if($player0style != "")
{
mysql_query("UPDATE LA4square_stylepoints SET
StylePointsAmount = '$player0style'
WHERE StylePointsPlayerNumber = '$player0num' AND
StylePointsMatchCourt = '$courts_select' AND
StylePointsMatchRound = '$rounds_select' AND
StylePointsMatchID = '$matchid' AND
StylePointsSeasonID = '$season_id'", $connection)
or die(mysql_error());
}
}
if($teams == "1")
{
  $player0team = $_POST['player0team'];
 
  //determining if player 0 already has stats listed for this match/round/court

  $player0_team_modifyoradd = mysql_query("SELECT LA4square_team_stats.TStatsPlayerNum AS teamplayerid
  FROM LA4square_team_stats
  WHERE LA4square_team_stats.TStatsPlayerNum = '$player0num' AND
  LA4square_team_stats.TStatsTeamID = '$player0team' AND
  LA4square_team_stats.TStatsSeasonID = '$season_id' AND
  LA4square_team_stats.TStatsMatchID = '$matchid' AND
  LA4square_team_stats.TStatsMatchRound = '$rounds_select' AND
  LA4square_team_stats.TStatsMatchCourt = '$courts_select'", $connection)
  or die(mysql_error());



  if(mysql_num_rows($player0_team_modifyoradd) == 0)
        {

    //if the player has no stats for this particular match/round/court/team, create them!
    mysql_query("INSERT INTO LA4square_team_stats SET
    TStatsPlayerNum = '$player0num',
    TStatsTeamID = '$player0team',
    TStatsMatchCourt = '$courts_select',
    TStatsMatchRound = '$rounds_select',
    TStatsMatchID = '$matchid',
    TStatsSeasonID = '$season_id',
    TStatsPoints = '$player0points',           
          TStatsEntries = '$player0entries',
          TStatsAces = '$player0aces',
          TStatsBodySacs = '$player0bodysacs',
          TStatsStylePoints = '$player0style',
            "$connection)
    or die(mysql_error());
        }
      else
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.