时间:2021-07-01 10:21:17 帮助过:23人阅读
MySQL TRUNCATE TABLE in PHP
<?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); ?>
php中MYSQL TRUNCATE的使用
标签:truncate local database pass table oca user cti localhost