Skip to content

Instantly share code, notes, and snippets.

@jorgeguberte
Created April 17, 2017 22:58
Show Gist options
  • Save jorgeguberte/e0ffc27ebcfe7b1cd227a6170cee5839 to your computer and use it in GitHub Desktop.
Save jorgeguberte/e0ffc27ebcfe7b1cd227a6170cee5839 to your computer and use it in GitHub Desktop.
$sql = "SELECT id, firstname, lastname FROM MyGuests";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
// output data of each row
while($row = mysqli_fetch_assoc($result)) {
echo '<pre>';
print_r($row);
echo '</pre>';
}
} else {
echo "0 results";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment