超出内存异常Xampp

时间:2015-12-02 16:09:46

标签: php doctrine silex dbal

我有这个功能:

public function RemplirTab($nomCol)
{
    $username = $this->getDb()->getUsername();
    $sql = "SELECT DISTINCT $nomCol
    FROM nautilus_users_page, nautilus_users_acces, nautilus_users_droit, nautilus_users_privilege, nautilus_users_menu
    WHERE nautilus_users_page.id_page = nautilus_users_acces.id_page
    AND nautilus_users_acces.id_droit = nautilus_users_droit.id_droit
    AND nautilus_users_droit.id_droit = nautilus_users_privilege.id_droit
    AND nautilus_users_page.id_menu = nautilus_users_menu.id_menu
    AND login='$username'";
    $row = $this->getDb()->fetchAssoc($sql, array($nomCol, $username));
    $i = -1;
    $Tab = array();
    while($result = $row)
    {
        $i = $i+1;

        $Tab[$i] = $result[$nomCol];

    }
    return $Tab;
}

这显示了一个错误: Error

我使用Silex和Doctrine DBAL。

此函数的形式为mysqli:

function RemplirTab($nomCol, $login)
{
    $sql = "SELECT DISTINCT $nomCol
            FROM nautilus_users_page, nautilus_users_acces, nautilus_users_droit, nautilus_users_privilege, nautilus_users_menu
            WHERE nautilus_users_page.id_page = nautilus_users_acces.id_page
            AND nautilus_users_acces.id_droit = nautilus_users_droit.id_droit
            AND nautilus_users_droit.id_droit = nautilus_users_privilege.id_droit
            AND nautilus_users_page.id_menu = nautilus_users_menu.id_menu
            AND login='$login'";
    $link = connectdb('nautilus_users');
    $req = execquery($link, utf8_decode($sql));
    $i = -1;
    while($row = $req->fetch_assoc())
    {
        $i = $i+1;

        $Tab[$i] = $row[$nomCol];

    }
    return $Tab;
}

0 个答案:

没有答案