/    Sign up×
Community /Pin to ProfileBookmark

Quick Parse Error Question

I get this error,

and here is the code minus my db query.

[B]Parse error: syntax error, unexpected T_STRING, expecting ‘]’ in /home/content/d/r/a/draftwatchers/html/nflsalaries/player.php on line 16
[/B]

[code=php]<?php

$result = mysql_query(“SELECT * FROM nflsalaries WHERE `player_id`=”.$_GET[id].” “);
while($row = mysql_fetch_assoc($result)){
$team = $row[team];
$player = $row[player];
$position = $row[pos];
$signedthru = $row[signedthru];
$eleven = $row[2011];
$elevenbase = $row[11bs];
$elevenwork = $row[11wk];
$elevenroster = $row[11ros];
$elevensb = $row[11sb];
$twelve = $row[2012];
$twelvebase = $row[12bs];
$twelvework = $row[12wk];
$twelveroster = $row[12ros];
$twelvesb = $row[12sb];
$thirteen = $row[2013];
$thirteenbase = $row[13bs];
$thirteenwork = $row[13wk];
$thirteenroster = $row[13ros];
$thirteensb = $row[13sb];
$fourteen = $row[2014];
$fourteenbase = $row[14bs];
$fourteenwork = $row[14wk];
$fourteenroster = $row[14ros];
$foourteensb = $row[14sb];
$fifteen = $row[2015];
$fifteenbase = $row[15bs];
$fifteenwork = $row[15wk];
$fifteenroster = $row[15ros];
$fifteensb = $row[15sb];
$sixteen = $row[2016];
$sixteenbase = $row[16bs];
$sixteenwork = $row[16wk];
$sixteenroster = $row[16ros];
$sixteensb = $row[16sb];
}

echo
“<h2>$player</h2>
<br />
<table width=685>
<tr>
<td>
<br />
</td>
<td><p>
$pic
<b>Position:</b> $position<br />
<b>College:</b> $college<br />
<b>Projection:</b> $projected<br />
<b>Selected Team:</b> $team<br />
<b>Overall Pick Number:</b> $pick<br />
<b>Draft Day Grade:</b> $draftgrade<br />
<h2>Analysis/Scouting Report:</h2><br/> $grade<br />
<h2>Combine Numbers</h2> $analysis<br />
<b>Height:</b> $height<br />
<b>Weight:</b> $weight<br />
<b>40 Time:</b> $fortytime<br />
<b>20 Time:</b> $twentydash<br />
<b>Bench Press:</b> $bench<br />
<b>Vertical:</b> $vertical<br />
<b>Three Cone:</b> $threecone<br />
<b>Twenty Yard:</b> $twentyyard<br />
<b>Sixty Yard:</b> $sixtyyard<br />
<b>Broad Jump:</b> $broadjump<br />
</td>
</tr>
</table>
<br />”;

?>[/code]

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogApr 14.2011 — You need to quote your array keys (if they are not integers). The keys are strings, not constants, and thus should be quoted. When not quoted, PHP is treating them as undefined constants (and assigning them a value the same as their name), but a constant's name cannot start with a number. See http://www.php.net/manual/en/language.types.array.php#language.types.array.foo-bar for more info.
Copy linkTweet thisAlerts:
@AB83RulesauthorApr 14.2011 — Thanks a bunch nogdog, i thought that was it but second guessed my self, lol.

Thanks again.
×

Success!

Help @AB83Rules spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...