TexasMd91 Posted August 20, 2007 Share Posted August 20, 2007 Hello, Is there a way to only get 1 row out of a table without outputting the rest of the rows? I am guessing it would be done in the query, so here is my query. $query = "SELECT player_id, player_name_uncolored, player_games_played, player_total_efficiency, player_total_kills, player_total_deaths FROM players"; Lets say I want to output only if the player_id = 1 How would I go about doing it? I know I could just do a loop, and use a IF Statement inside of it to see if its 1. But is there a better way of doing this? Cause ATM, There is currently 11635 player_id, and doing it that way would probably put to much stress on it if its doing the script every few seconds. and plus it would probably take a few seconds longer. Quote Link to comment https://forums.phpfreaks.com/topic/65843-basic-mysql-question/ Share on other sites More sharing options...
chocopi Posted August 20, 2007 Share Posted August 20, 2007 use WHERE $query = "SELECT player_id, player_name_uncolored, player_games_played, player_total_efficiency, player_total_kills, player_total_deaths FROM players WHERE player_id='1'"; That should work ~ Chocopi Quote Link to comment https://forums.phpfreaks.com/topic/65843-basic-mysql-question/#findComment-329045 Share on other sites More sharing options...
TexasMd91 Posted August 20, 2007 Author Share Posted August 20, 2007 Alright thanks for the quick reply php freaks ftw Quote Link to comment https://forums.phpfreaks.com/topic/65843-basic-mysql-question/#findComment-329050 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.