$g["on_delete"] = array("delete_podria", null, true);
$grid->set_events($g);
function delete_podria($data)
{
$str = "DELETE FROM podria WHERE n_gp = {$data["n_gp"]} and n_grupo = {$data["params"]["n_grupo"]} and n_idioma = {$data["params"]["n_idioma"]} and n_usuario = {$data["params"]["n_usuario"]}";
mysql_query($str);
}
This code should work if you have correct data in $data var.
You can debug it by:
{
phpgrid_error($data);
…
}
this will show the $data content in error message on grid.
Hi Abu,
SELECT n_gp,n_grupo,n_usuario,n_idioma FROM usuario_podria
$col = array();
$col["title"] = "n_gp";
$col["name"] = "n_gp";
$col["width"] = "10";
$col["hidden"] = true;
$col["align"] = "right";
$cols[] = $col;
$col = array();
$col["title"] = "n_grupo";
$col["name"] = "n_grupo";
$col["width"] = "10";
$col["hidden"] = true;
$col["align"] = "right";
$cols[] = $col;
$col = array();
$col["title"] = "n_idioma";
$col["name"] = "n_idioma";
$col["width"] = "10";
$col["hidden"] = true;
$col["align"] = "right";
$cols[] = $col;
$col = array();
$col["title"] = "n_usuario";
$col["name"] = "n_usuario";
$col["width"] = "10";
$col["hidden"] = true;
$col["align"] = "right";
$cols[] = $col;
ob_start();
print_r($data);
phpgrid_error(ob_get_clean());
This show n_gp => 14 only.
but I want to
n_gp => 14,n_grupo => 2,n_idioma => 1,n_usuario => 1
Thank you for your time!