I have this following code that delete a mysql record and I would like to transform it so It would be a ajax/jquery code so I can stay in the same page after the record has been deleted from the table.
Now, it working fine but it not on the same page and I need to refresh the page to see the result. This is only a part of the full code.
All the code in on one page.
//get the mysql results
//this is a repeated region
<tr>
<td><?php echo $row['id']; ?></td>
<td><?php echo $row['title']; ?></td>
<td><?php echo $row['description']; ?></td>
<td><a href="manage.php?id=<?php echo $row['id']; ?>">Delete</a>
</td>
</tr>
if ((isset($_GET['deleteid'])) && ($_GET['deleteid'] != "") && (isset($_POST['delete']))) {
$deleteSQL = sprintf("DELETE FROM my_table WHERE id=%s",
GetSQLValueString($_GET['deleteid'], "int"));
Now in the section write this
Now in the ‘delete_page.php’ page do this
Rest I hope you know. Hope this helps