Created
July 12, 2013 05:36
-
-
Save anatooly/5982119 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$rc = 0; | |
$host = '127.0.0.1'; | |
$user = 'root'; | |
$password = ''; | |
$database = 'test'; | |
$port = 3306; | |
$socket = null; | |
$cflag = 0; | |
$mysqli = new mysqli($host, $user, $password, $database, $port, $socket); | |
/* check connection */ | |
if ($mysqli->connect_errno) { | |
printf("Error %d: Connection failed: %s\n", $mysqli->connect_errno, $mysqli->connect_error); | |
exit; | |
} | |
printf("Connected to MySQL server version: %s\n", $mysqli->server_info); | |
$sql = 'SELECT * FROM test LIMIT 999990, 10'; | |
$rc = $mysqli->query($sql); | |
if (! $rc) { | |
printf("Error %d: Query failed: %s\n", $mysqli->connect_errno, $mysqli->connect_error); | |
exit; | |
} | |
$row = array(); | |
while ($row = $rc->fetch_row()) { | |
printf("Key: %s, value: %s\n", $row[0], $row[1]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment