php中MYSQL TRUNCATE的使用

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的使用

上一篇:windows 启动关闭Oracle监听和服务 (转载)


下一篇:【涛舅舅独门建站技巧】利用.htaccess文件实现子域名映射二级目录