0
I need to query my database with something like AJAX/JSON I’m not sure and return the result within a div
next to this map. There already exists a div
next to receive the result of the consultation.
I’m not sure how I can start doing this but I created the PHP script that will make the query, follows:
<?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 to make this action be fired 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();
});