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] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.