我将在 PDO 中使用什么而不是旧的 mysql_resul()?
function ib_uk_isvalid($db,$uk) {
    try {
    $sth = $db->prepare("SELECT count(*) FROM ib_userkeys WHERE value=:val");
    $sth->bindParam(":val",$uk);
    $sth->execute();
    $numrows = $sth->fetchColumn();
    if($numrows>=1) {
        $sth2 = $db->prepare("SELECT * FROM ib_userkeys WHERE value=:val");
        $sth2->bindParam(":val",$uk);
        $sth2->execute();
        $res = $sth2->fetchAll();
        print($res[0]->type);
    } else {
    return 0;
    }
    } catch (PDOException $e) {
        return $e->getMessage();
    }
}
ib_uk_isvalid($db,1234)
给我错误,因为它返回表而不是对象(我需要)。