HcWestergaard Posted March 24, 2013 Share Posted March 24, 2013 hej I'm making a website and have some problems with. Someone who can make a script where you have to press a button to delete all the rows in my table Thanks Quote Link to comment https://forums.phpfreaks.com/topic/276096-delete-database-rows-whit-php-button/ Share on other sites More sharing options...
davidannis Posted March 24, 2013 Share Posted March 24, 2013 $query="DELETE FROM `mydatabase` WHERE 1"; $reslut = mysqli_query($link, $query); you need to connect to your database first, maybe validate the input, but that should get you started. Quote Link to comment https://forums.phpfreaks.com/topic/276096-delete-database-rows-whit-php-button/#findComment-1420773 Share on other sites More sharing options...
Barand Posted March 24, 2013 Share Posted March 24, 2013 $query="TRUNCATE TABLE `mydatabase`"; mysqli_query($link, $query); Faster. Quote Link to comment https://forums.phpfreaks.com/topic/276096-delete-database-rows-whit-php-button/#findComment-1420780 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.