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 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. 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. 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
Archived
This topic is now archived and is closed to further replies.