首页 >后端开发 >php教程 >php中MYSQL TRUNCATE的使用

php中MYSQL TRUNCATE的使用

WBOY
WBOY原创
2016-06-23 13:47:551066浏览

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);?>


声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn