Skip to content

Instantly share code, notes, and snippets.

@danielkhan
Last active June 22, 2016 06:42
Show Gist options
  • Save danielkhan/43d8df079ea72080dff3 to your computer and use it in GitHub Desktop.
Save danielkhan/43d8df079ea72080dff3 to your computer and use it in GitHub Desktop.
<?php
// Connect to mySQL (*blocking*)
$link = mysqli_connect("localhost", "user", "password", "test");
// Run a query and store result object (*blocking*)
if($result = mysqli_query($link, "SELECT * FROM Person")) {
// Fetch data from phps internal buffer into $data
$data = mysqli_fetch_all($result);
// Output the data to the browser
print_r($data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment