The query mysql works with normal variable, but not with the jquery post variable, for example:
DOES NOT WORK
$agenda=$_POST['agenda'];
$query = mysql_query("SELECT * FROM 'compromiso' WHERE login LIKE 'alanps' AND agenda LIKE '$agenda' AND ano LIKE '$ano' AND mes LIKE '$mes' AND dia LIKE '$list_day'") or die(mysql_error());
WORKS
$agenda="Agenda 1";
$query = mysql_query("SELECT * FROM 'compromiso' WHERE login LIKE 'alanps' AND agenda LIKE '$agenda' AND ano LIKE '$ano' AND mes LIKE '$mes' AND dia LIKE '$list_day'") or die(mysql_error());
jquery's post:
$.post('calendario.php', {
mes: mes,
ano: ano,
agenda: $("#agendanome").html()
}, function(resposta) {
$("#calendario").html(resposta);
}, 'html');
If I give a print $agenda;
it appears "Agenda 1" both ways!
I also tried $agenda=html_entity_decode($agenda);
and it did not work!