Here is a fragment of my grid js:
$grid.jqGrid({
url:'xtras/Products.php',
editurl:'xtras/Products.php',
datatype: "json",
mtype:'GET',
colModel:[...
{name:'ID',index:'catalogue.ID', hidden:true, width:10, sortable:false, editable:true, key:true},
....]
and PHP side:
elseif ($_REQUEST["oper"] == "del") {
$deleteSQL = sprintf("delete from snapper.catalogue where `catalogue`.`ID` = %s",
GetSQLValueString($_REQUEST['ID'], "int")
);
$Result = mysqli_query($GLOBALS["___mysqli_ston"],$deleteSQL) or die($error = mysqli_error($GLOBALS["___mysqli_ston"]));
}
where $_REQUEST['ID']
not passed to $_REQUEST["oper"] == "del"
, however it does pass to $_REQUEST["oper"] == "edit"
EDIT dump:
_REQUEST - 2015-11-25 12:59:53:
Array
(
[Catalogue] => test523
[Artist] => STEPHANE GRAPPELLI
[Title] => kkk1651564
[UKDP] => 5.50
[Release_Date] => 25 Nov 15
[Ppoint] => 1
[Label] => 2
[Format] => 33
[Genre] => 27
[UPCEAN] => 636551052375
[AlbumCLineYear] => 0
[AlbumCLineInfo] =>
[AlbumPLineYear] => 0
[AlbumPLineInfo] =>
[Credits] =>
[Artist_Sort] =>
[Active] => 1
[Deleted] => 1
[id] => 1951
[copyID] =>
[oper] => edit
)
DEL dump:
_REQUEST - 2015-11-25 13:00:49:
Array
(
[oper] => del
[id] => 4
)
where [id]
is row number in the grid, not ID
in the database. Why?