Pyro Posted September 13, 2008 Share Posted September 13, 2008 hey people, just wondering stuck on this php action first one for ages, could someone please tell me how to make this piece of code delete all? if ($_GET['action'] == "wipe" ){ $id = $_GET['id']; $stresult = mysql_query("DELETE FROM replys WHERE id='$id'") or die(mysql_error()); echo "All forum posts have been deleted.";} Quote Link to comment https://forums.phpfreaks.com/topic/124112-solved-delete-all/ Share on other sites More sharing options...
ratcateme Posted September 13, 2008 Share Posted September 13, 2008 shouldn't DELETE FROM `replys` work Scott. Quote Link to comment https://forums.phpfreaks.com/topic/124112-solved-delete-all/#findComment-640739 Share on other sites More sharing options...
Pyro Posted September 13, 2008 Author Share Posted September 13, 2008 oh yeah durrrr didn't think of that lol xD thanks dude lol i don't have any common sense xD Quote Link to comment https://forums.phpfreaks.com/topic/124112-solved-delete-all/#findComment-640740 Share on other sites More sharing options...
wildteen88 Posted September 13, 2008 Share Posted September 13, 2008 DELETE should be used to delete specific rows. You should use 'TRUNCATE TABLE tablename' to clear a tables contents. Quote Link to comment https://forums.phpfreaks.com/topic/124112-solved-delete-all/#findComment-640743 Share on other sites More sharing options...
Pyro Posted September 13, 2008 Author Share Posted September 13, 2008 yeah i have just relised looking at it, thanks Quote Link to comment https://forums.phpfreaks.com/topic/124112-solved-delete-all/#findComment-640745 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.