我想用php清除MySQL中一张表中的所有条目我试过这个:
<?php
// Create connection
$con=mysqli_connect("localhost","username","password","dbName");
// Check connection
if (mysqli_connect_errno($con))
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql = "TRUNCATE TABLE tableName";
mysqli_query($sql);
?>
但它没有用。为什么?