nachotico Posted February 28, 2007 Share Posted February 28, 2007 Just to help some fulks who don't know that and helping to grow the community <?php $host="localhost"; $username="user"; $password="mysql_password"; $database="database_name"; $table="table_name"; $connection = mysql_connect("$host", "$username", "$password") or die ("Unable to connect to server"); mysql_select_db("$database") or die ("Unable to select database"); $sql = "TRUNCATE TABLE `$table`"; mysql_query($sql); echo "Table Deleted"; mysql_close($connection); ?> have a nice day... Quote Link to comment https://forums.phpfreaks.com/topic/40468-mysql-truncate-table-in-php/ Share on other sites More sharing options...
fenway Posted February 28, 2007 Share Posted February 28, 2007 That's such a very scary script. Quote Link to comment https://forums.phpfreaks.com/topic/40468-mysql-truncate-table-in-php/#findComment-196027 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.