Guest User

mysql_select

a guest
Jun 19th, 2013
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. <?php
  2. $mtime = explode(' ', microtime());
  3. $tstart = $mtime[1] + $mtime[0];
  4. //////////////////////////////////
  5.  
  6. $link = mysql_connect('localhost', 'miha', 'qwerty');
  7. mysql_select_db('mysql', $link);
  8. mysql_query("set names utf8", $link);
  9.  
  10. for ($i = 0; $i < 1000; $i++)
  11. {
  12.     $s = mysql_query("SELECT * FROM `help_relation` WHERE `help_keyword_id` = $i", $link);
  13.     echo 'rowCount: '.mysql_num_rows($s).'<br>';
  14. }
  15.  
  16. //////////////////////////////////
  17. $mtime = explode(' ', microtime());
  18. $mtime = $mtime[1] + $mtime[0];
  19. echo '<br><br>Time: '.round((($mtime - $tstart) * 1000), 4).' мс<br>';
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment