0

我将开始使用此查询获取现有表:

    <?php
        $tblArray = array($cvsShop01, $cvsShop02, $cvsShop03, $cvsShop04, $cvsShop05);
        $dbh = new ShopSM01DB_Mysql_Extended;
        foreach($tblArray as $table) {
            $query = "SHOW TABLES LIKE '%$table%'";
            $data = $dbh->prepare($query)->execute($cvsShop01, $cvsShop02, $cvsShop03, $cvsShop04, $cvsShop05)->fetchall_assoc();
            if(!$data) {
                return false;
            } else {
                return $data;
            }
        }
    ?>

它将输出以下数组:

    <?php
        [0] => Array
        (
            [Tables_in_testTable (%table%)] => dc_01
        )
        [1] => Array
        (
            [Tables_in_testTable (%table%)] => dc_01_2
        )
    ?>

我怎样才能用 foreach 读出来?

4

0 回答 0