Via PDO
, I can do the TRUNCATE
(English) of a table as follows:
// Matriz de definições
$dbcon_new = array(
"host" => "localhost",
"dbname" => "bubu",
"username" => "super_dragon",
"password" => "balls"
);
// estabelece a ligação
$dbh = new PDO(
'mysql:host='.$dbcon_new['host'].';dbname='.$dbcon_new['dbname'].';',
$dbcon_new['username'],
$dbcon_new['password'],
array(
PDO::ATTR_PERSISTENT => false,
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"
)
);
// esvazia a tabela xpto
$dbh->exec("TRUNCATE TABLE xpto");
Question
How can I make a single run to TRUNCATE
to multiple tables?