Skip to content

Instantly share code, notes, and snippets.

Created Sep 14, 2015
What would you like to do?
$pdo=new PDO("mysql:dbname=markers;host=","root","");
$stmt = $pdo->query("SELECT * FROM markers");
$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
echo json_encode($results);
<script id="source" language="javascript" type="text/javascript">
url: 'test.php',
data: "",
dataType: 'json',
success: function(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment