Delete a row from a php grid
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?
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
As soon as i explore a bug free code for deletion of record i'll post it.
Otherwise flow is this only.
This topic is archived.
Back to support forum
Version 2Looking for AW 2.6 ?
The old site is here.