Jump to content

Basic MySQL Question.


TexasMd91

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/65843-basic-mysql-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.