Skip to content

Instantly share code, notes, and snippets.

/gist:d87109f28481ce6c6f39 Secret

Created Sep 14, 2015
Embed
What would you like to do?
<?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);
?>
<script id="source" language="javascript" type="text/javascript">
$(function(){
$.ajax({
url: 'test.php',
data: "",
dataType: 'json',
success: function(data)
{
//alert(data[2].desc);
console.log(data[2].desc);
}
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.