21,893
社区成员




$mysqli = new mysqli("127.0.0.1", "root", "123456", "testdb");
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$query = "select * from person";
if ($result = $mysqli->query($query)) {
while ($obj = $result->fetch_assoc()) {
printf ("%s (%s)\n", $obj["idPerson"], $obj["idPerson"]);
}
$result->close();
}
$mysqli->close();