[PDO]①③--debugDumpParams

$stmt->fetchColumn

[PDO]①③--debugDumpParams_第1张图片
Paste_Image.png
query($sql);
    echo $stmt->fetchColumn(0), "
"; echo $stmt->fetchColumn(1), "
"; echo $stmt->fetchColumn(2), "
"; } catch (PDOException $e) { echo $e->getMessage(); } ?>
Paste_Image.png
[PDO]①③--debugDumpParams_第2张图片
Paste_Image.png

$stmt->debugDumpParams()

prepare($sql);
    $stmt->bindParam(1, $username, PDO::PARAM_STR);
    $stmt->bindParam(2, $password, PDO::PARAM_STR);
    $stmt->bindParam(3, $email, PDO::PARAM_STR);
    $username = 'testParam';
    $password = 'testParam';
    $email = '[email protected]';
    $stmt->execute();
    $stmt->debugDumpParams();

} catch (PDOException $e) {
    echo $e->getMessage();
}
?>
[PDO]①③--debugDumpParams_第3张图片
Paste_Image.png
prepare($sql);
    $stmt->bindParam(':username', $username, PDO::PARAM_STR);
    $stmt->bindParam(':password', $password, PDO::PARAM_STR);
    $username = 'testParam3';
    $password = 'testParam4';
    $email = '[email protected]';
    $stmt->execute();
    $stmt->debugDumpParams();
} catch (PDOException $e) {
    echo $e->getMessage();
}
?>
[PDO]①③--debugDumpParams_第4张图片
Paste_Image.png

你可能感兴趣的:([PDO]①③--debugDumpParams)