I need to query my database with something like AJAX / JSON I'm not sure and return the result inside a div
next to this # . div
is already on the side to receive the result of the query.
I'm not sure how I can start doing this but I've created the PHP script that will query it:
<?php
require("conexao.php");
$estado = $_GET['b_estado'];
$ret = mysql_query("SELECT post_content FROM wp_posts WHERE post_type = 'estados' AND post_title = '$estado' AND post_status = 'publish'");
$array = mysql_fetch_assoc($ret);
$dados = $array['post_content'];
json_encode($dados);
?>
How do I get this action triggered with the following script in jQuery?
$("#map li a").on("click", function(e) {
e.preventDefault();
var estado = $(this).attr("id");
var b_estado = estado.toUpperCase();
});