I am new to using PHP to run SQL commands but what I'm trying to do is truncate specific tables within my database when the script is run. I can do this fine truncating just one table but when I attempt multiple table I run into issues! Code is below, any pointers?! Thanks in advance
<?php
var_dump($_POST);
$myServer = $_POST['host'];
$myUser = $_POST['user'];
$myPass = $_POST['password'];
$myDB = $_POST['db'];
$con = mysqli_connect($myServer, $myUser, $myPass) or die("Connection
Failed");
mysqli_select_db($con, $myDB)or die("Connection Failed");
$query = ("
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE table customers;
TRUNCATE table customers2;
SET FOREIGN_KEY_CHECKS = 1;
");
if(mysqli_query($con, $query)){
echo "table empty";}
else{
echo("Error description: " . mysqli_error($con));}
?>