Does anyone know why the variables are not interpreted?
I'm passing via ajax with data:{"inicio=0&fim=2"}
and when I try to return to the query I can not.
$.ajax({
url: 'php/teste.php',
type: 'POST',
data: "inicio=0&fim=2",
beforeSend: '',
error: '',
success: function(leitura){
alert(leitura);
}
});
test.php
$inicio = $_POST['inicio'];
$fim = $_POST['fim'];
$usuarios = mysql_query("SELECT * FROM usuario LIMIT $inicio,$fim") or die(mysql_error());
I have already used ( int
) but it returns 0
;
Mysql 5.7