-
-
Save anonymous/d87109f28481ce6c6f39 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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