Guest User

Untitled

a guest
Nov 9th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. <?php
  2. $port = isset($argv[1]) && $argv[1] === '--with-proxy' ? 6033 : 3306;
  3. $host = '192.168.33.38';
  4. $username = 'root';
  5. $password = 'Ehu4t/aDifyMNUZy';
  6. $dbname = 'demo';
  7. $card_number = '4743-5730-9962-4995';
  8.  
  9. $conn = mysqli_connect($host, $username, $password, $dbname, $port);
  10. if (!$conn) {
  11. die("Unable to connect to db " . mysqli_connect_error());
  12. }
  13.  
  14. $time_start = microtime(true);
  15. $number_of_queries = 10;
  16. for ($i = 0; $i < $number_of_queries; $i++) {
  17. $sql = "select * from credit_cards where number = '$card_number'";
  18. if (!mysqli_query($conn, $sql)) {
  19. die("Unable to perform query. " . mysqli_error($conn));
  20. }
  21. }
  22. $time_end = microtime(true);
  23. echo printf("Proceed in %d seconds", $time_end - $time_start);
  24.  
  25. mysqli_close($conn);
  26. ?>
Add Comment
Please, Sign In to add comment