dink87522 Posted December 29, 2009 Share Posted December 29, 2009 mysql_select_db("amazon_Score") or die(mysql_error()); $query = SELECT ageGroup FROM Highscores WHERE ageGroup = "16-30"; $result = mysql_query($query) or die(mysql_error()); Why do I get a T string error (2nd line)? I want to select all the data from the column ageGroup whose value is equal to "16-30". Link to comment https://forums.phpfreaks.com/topic/186568-mysql-select-from-help/ Share on other sites More sharing options...
Buddski Posted December 29, 2009 Share Posted December 29, 2009 You need to wrap your query it quotes.. $query = 'SELECT ageGroup FROM Highscores WHERE ageGroup = "16-30"'; Link to comment https://forums.phpfreaks.com/topic/186568-mysql-select-from-help/#findComment-985298 Share on other sites More sharing options...
btherl Posted December 29, 2009 Share Posted December 29, 2009 You probably want "SELECT *" rather than "SELECT ageGroup" too. Link to comment https://forums.phpfreaks.com/topic/186568-mysql-select-from-help/#findComment-985345 Share on other sites More sharing options...
dink87522 Posted December 29, 2009 Author Share Posted December 29, 2009 Okay, thanks for the help Link to comment https://forums.phpfreaks.com/topic/186568-mysql-select-from-help/#findComment-985383 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.