Skip to content

Instantly share code, notes, and snippets.

@rob1121
Created May 16, 2018 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rob1121/e77f53d3d90268b3e1b8860281c93e85 to your computer and use it in GitHub Desktop.
Save rob1121/e77f53d3d90268b3e1b8860281c93e85 to your computer and use it in GitHub Desktop.
//connect to db
$query = $handler->query("SLECT * FROM tbl_name");
$data = [];
if ($query->rowCount()) {
$data = $query->fetchAll(PDO::FETCH_OBJ);
} else {
echo "NO RESULT";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment