Skip to content

Instantly share code, notes, and snippets.

@sebgates
Last active May 21, 2018 16:49
Show Gist options
  • Save sebgates/f4822a186d72953487e9690b58f3f991 to your computer and use it in GitHub Desktop.
Save sebgates/f4822a186d72953487e9690b58f3f991 to your computer and use it in GitHub Desktop.
// Get data from database
// Replace 'your-table' with the name of your own table
$query = "SELECT * FROM your-table";
$statement = $db->prepare($query);
$statement->execute();
$heros = $statement->fetchAll(PDO::FETCH_ASSOC);
$statement->closeCursor();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment