Please, i have this code here which helps me to extract a few rows from my database into a grid.
Now i have this select all option. Here is the function:
function removeUser(){
var row = $('#dg').datagrid('getSelected');
if (row){
$.messager.confirm('Confirm','Are you sure you want to remove this user?',function(r){
if (r){
$.post('remove_er.php',{id:row.id},function(result){
if (result.success){
$('#dg').datagrid('reload'); // reload the user data
} else {
$.messager.show({ // show error message
title: 'Error',
msg: result.msg
});
}
},'json');
}
});
}
}
And the php:
$id = intval($_REQUEST['id']);
$sql = "delete from rbpos_epos where id=$id";
$result = @mysql_query($sql);
Where do i have to modify in order to delete all the selected rows? For the moment even though i have selected all, i still can delete just one record..
Thanks..