envexlabs Posted May 17, 2007 Share Posted May 17, 2007 Hey, I've been able to get AJAX to delete a row in a mysql table, but how would i make the PHP file show that the row has been deleted? index.php [$query = mysql_query('SELECT * FROM `testing`'); while($i = mysql_fetch_row($query)) { echo $i[0] . "<br />"; echo $i[1] . "<br />"; echo $i[2] . "<br />"; echo '<a href="javascript: MyAjaxRequest(\'main\',\'hello.php?ID=' . $i[2] .'\')">Delete</a><br />'; } ?>/code] [color=red]hello.php[/color] [code]if($_GET[iD] == "") { echo "nothing"; }else{ $delete = mysql_query('DELETE FROM `testing` WHERE ID = ' . $_GET[iD] . ''); } Thanks, envex[/code] Link to comment https://forums.phpfreaks.com/topic/51853-mysql-delete-and-refresh/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.