PHP | MySQL | 多个查询以使用information_schema列

I have a query that works via phpMyAdmin:

SET @sql = CONCAT('SELECT ', (SELECT GROUP_CONCAT(COLUMN_NAME) FROM information_schema.columns where table_name='staff' and table_schema='tag'), ' FROM tag.staff WHERE staff_id=1;'); 
PREPARE stmt1 FROM @sql; 
EXECUTE stmt1;

But when I try to run it from a php file, I get no rows returned.

I understand from googling that there's a problem with running multiple queries from php and one tip I saw suggested a stored procedure. I also tried this but it threw an error:

$this->_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
$stmt = $this->_db->prepare($part1);
$stmt->execute();

But for the most part I didn't understand the few answers I found (neither my PHP or SQL are advanced).

Has anyone done this before?

Thanks Emma

This code worked for me bevor!

<?php
$mysqli = new mysqli("example.com", "user", "password", "database");
if ($mysqli->connect_errno) {
    echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
}

if (!$mysqli->query("DROP TABLE IF EXISTS test") || !$mysqli->query("CREATE TABLE test(id INT)")) {
    echo "Table creation failed: (" . $mysqli->errno . ") " . $mysqli->error;
}

$sql = "SELECT COUNT(*) AS _num FROM test; ";
$sql.= "INSERT INTO test(id) VALUES (1); ";
$sql.= "SELECT COUNT(*) AS _num FROM test; ";

if (!$mysqli->multi_query($sql)) {
    echo "Multi query failed: (" . $mysqli->errno . ") " . $mysqli->error;
}

do {
    if ($res = $mysqli->store_result()) {
        var_dump($res->fetch_all(MYSQLI_ASSOC));
        $res->free();
    }
} while ($mysqli->more_results() && $mysqli->next_result());
?>