-4
Does anyone know why 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’m not getting.
$.ajax({
url: 'php/teste.php',
type: 'POST',
data: "inicio=0&fim=2",
beforeSend: '',
error: '',
success: function(leitura){
alert(leitura);
}
});
php test.
$inicio = $_POST['inicio'];
$fim = $_POST['fim'];
$usuarios = mysql_query("SELECT * FROM usuario LIMIT $inicio,$fim") or die(mysql_error());
I’ve used the (int
) but get back to me 0
;
Mysql 5.7
Please avoid long discussions in the comments; your talk was moved to the chat
– Maniero