PHP mysqli slow loading.
Evening all! 

I'm optimizing my website, and I'm running into some peculiar behaviour.  Before, I assumed it was because of the calculations being done on the data I was using, but I'm starting to question this.  

I find that running some code like: 

    for ($i=0; $i < 55 ; $i++) { 
	  $query = "SELECT id FROM gamedata_concepts WHERE game_id=12277";

	  if ($result = $mysqli->query($query){
	  }
    }

Takes about 3 seconds, however, if I call that query once in say, phpMyAdmin, it says it takes '.0121' seconds, multiply that by 55 (the testing number used above in the loop), and it SHOULD take appx. .6655 seconds.  I'm curious as to maybe where this backend is?  Or better, how I can engineer this better to be more efficient.  

Thanks. 
PHP mysqli slow loading.
===

Evening all! 

I'm optimizing my website, and I'm running into some peculiar behaviour.  Before, I assumed it was because of the calculations being done on the data I was using, but I'm starting to question this.  

I find that running some code like: 

    for ($i=0; $i < 55 ; $i++) { 
	  $query = "SELECT id FROM gamedata_concepts WHERE game_id=12277";

	  if ($result = $mysqli->query($query){
	  }
    }

Takes about 3 seconds, however, if I call that query once in say, phpMyAdmin, it says it takes '.0121' seconds, multiply that by 55 (the testing number used above in the loop), and it SHOULD take appx. .6655 seconds.  I'm curious as to maybe where this backend is?  Or better, how I can engineer this better to be more efficient.  

Thanks. 