Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $port = isset($argv[1]) && $argv[1] === '--with-proxy' ? 6033 : 3306;
- $host = '192.168.33.38';
- $username = 'root';
- $password = 'Ehu4t/aDifyMNUZy';
- $dbname = 'demo';
- $card_number = '4743-5730-9962-4995';
- $conn = mysqli_connect($host, $username, $password, $dbname, $port);
- if (!$conn) {
- die("Unable to connect to db " . mysqli_connect_error());
- }
- $time_start = microtime(true);
- $number_of_queries = 10;
- for ($i = 0; $i < $number_of_queries; $i++) {
- $sql = "select * from credit_cards where number = '$card_number'";
- if (!mysqli_query($conn, $sql)) {
- die("Unable to perform query. " . mysqli_error($conn));
- }
- }
- $time_end = microtime(true);
- echo printf("Proceed in %d seconds", $time_end - $time_start);
- mysqli_close($conn);
- ?>
Add Comment
Please, Sign In to add comment