Getting an error in SQL syntax and can't figure out why:
(PHP + MySQL, using mysql_error())
table structure (table called 'players'):
SQL query:
error:
I've tried putting backticks (`) around "active" to no effect. Additionally, this is some code I'm upgrading, and the previous version (used same syntax here with same relevant DB structure) had, and still has, no problems with this. Furthermore, I've successfully accessed 'players' elsewhere without referencing "active".
(PHP + MySQL, using mysql_error())
table structure (table called 'players'):
Code:
Field Type Attributes Null Default
player_id smallint(5) UNSIGNED No auto_increment
lname varchar(50) Yes NULL
fname varchar(50) Yes NULL
picture_loc varchar(25) Yes NULL
nflteam_id tinyint(3) UNSIGNED Yes NULL
position_id tinyint(3) UNSIGNED Yes NULL
active tinyint(1) Yes 1
nfl_profile varchar(100) Yes NULL
Code:
SELECT player_id FROM players WHERE active=1
Unknown column 'active' in 'where clause'
I've tried putting backticks (`) around "active" to no effect. Additionally, this is some code I'm upgrading, and the previous version (used same syntax here with same relevant DB structure) had, and still has, no problems with this. Furthermore, I've successfully accessed 'players' elsewhere without referencing "active".