hopbop Posted April 14, 2012 Share Posted April 14, 2012 hello i have this code here to delete people form a call list but it is not deleting form it could I get a some help? the form <?php include '../config.php'; $query="SELECT * FROM call_list WHERE ecs = 'Jam' order by date desc"; $result=mysql_query($query); echo mysql_error(); //////////////// Now we will display the returned records in side the rows of the table///////// while($row = mysql_fetch_array($result)) { echo " <table id='call_list'> <form name='Call_delet' action='del.php' method='get'> <tr> <td class='call_names'> $row[Fname] $row[Lname] </td> <td class='call_numbers'> $row[phone] </td> <td class='call_email'> $row[email] </td> <td class='call_email'> $row[calltime] </td> <td> <a href='del.php?del=$row[id]'>Del</a> </td> </tr> </form> </table> "; } ?> del.php page <?php include '../config.php'; if (isset($_GET['id']) && is_numeric($_GET['id'])) { $id = $_GET['id']; $result = mysql_query("DELETE FROM call_list WHERE id=$id") or die(mysql_error()); header("Location: view.php"); } else { echo"dident work"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/260939-why-wont-this-delete-data/ Share on other sites More sharing options...
litebearer Posted April 14, 2012 Share Posted April 14, 2012 1. echo $_GET['id'] 2. try putting single quotes around $id in your query Quote Link to comment https://forums.phpfreaks.com/topic/260939-why-wont-this-delete-data/#findComment-1337356 Share on other sites More sharing options...
hopbop Posted April 14, 2012 Author Share Posted April 14, 2012 1. echo $_GET['id'] 2. try putting single quotes around $id in your query thank you for the reply this did help me once I tryed to echo $_GET['id'] i came to the thought that it's not declared id in the url but del so once i cuckeld a bit and my head went to my desk hard (been trying to fig this out for 2 hours ) i replaced $_GET['id'] with $_GET['del'] now it all works thank you ......... I think i need to sleep more lol Quote Link to comment https://forums.phpfreaks.com/topic/260939-why-wont-this-delete-data/#findComment-1337357 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.