0
所以我在一个特定的表,其中的用户名是已在数据库中,像这样抓行量:PHP PDO rowCount不工作?我认为
$second_sql = $db->prepare("SELECT * FROM users WHERE username = :username");
$second_sql->bindParam(':username', $username);
$second_sql->execute();
if($second_sql->rowCount() == 1) {
$db = null;
header("Location: ../login/");
} else {
$statement->execute();
$db = null;
}
的问题是它不工作。如果你需要更多的脚本,请告诉我。
“不工作”是什么意思? – Chris
这不是抓行数。 –
你没有取任何东西。你缺少$ result = $ second_sql-> fetchAll(); – happymacarts