3.2.0

Delete a row from a php grid

Hi all,

I have been searching the forum for a few hours and still can't find any simple instructions on how to delete a row from a grid in php. Does anyone have a simple example?

Ideally I would like multiple row selection, and for the user to simply press "delete key", a confirmation box, and then to delete the rows from the grid, delete the rows from mySQL and then refresh the grid.

I am just using the simple:
----
// grid object name
$name = "obj";

// SQL query
$query = "select number,message,datetime AS Date from tl_numbers WHERE customer = '$user' ";

$result = mysql_query($query);

// add grid to the page
echo activewidgets_grid($name, $result);
---

Can someone help me with the next few steps?

Many thanks,

Alastair
Alastair
November 12,
Me looking for the same, but could suggest u smthg which may help u
Create the grid loading the data, with row indices as the unique ids of
your data in the DB.

Write the code on the keypress event of delete button(keyCode=46 for delete button)
through XMLHTTPRequest method, Pass the row index to a PHP script and
then handle that script to delete the record from the DB based on the value of the row index
Remember ur row index shud be the unique id of the record meant to be
deleted.

As soon as i explore a bug free code for deletion of record i'll post it.
Otherwise flow is this only.

Cheers :)
Ritesh Jagga
November 23,
can someone show this?
my regards
vule
November 26,

This topic is archived.

See also:


Back to support forum