I have this line of sql which gives me a syntax error following the closing parenthesis of the select statement. I was under the belief that I could write the code this way. Is there some alternative?
The variables inside the select statement come from GET and the others come from POST. Any help is appreciated.
$sql2="INSERT INTO playerRegSeason
(playerID, year, teamID, gp, minutes, pts, oreb, dreb, reb,
asts, stl, blk, turnover, pf, fga, fgm, fta, ftm, tpa, tpm)
VALUES ((
SELECT playerID FROM players WHERE firstname='$firstname'
AND lastname='$lastname' AND firstseason=$firstseason), $year,
'$team', $gp, $minutes, $pts, $oreb, $dreb, $reb, $asts, $stl,
$blk, $turnover, $pf, $fga, $fgm, $fta, $ftm, $tpa, $tpm)";