Skip to content

Instantly share code, notes, and snippets.

@lorenmh
Created September 13, 2015 22:02
Show Gist options
  • Save lorenmh/543a9724798ebb836e18 to your computer and use it in GitHub Desktop.
Save lorenmh/543a9724798ebb836e18 to your computer and use it in GitHub Desktop.
<?php
$pdo=new PDO("mysql:dbname=markers;host=127.0.0.1","root","");
$stmt = $pdo->query("SELECT * FROM markers");
$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
echo json_encode($results);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment