1
我試圖使PDO查詢下面的工作,但不知何故它不。 這是我的腦子爆炸了多遠! 有沒有人可以說我doint錯了?PDO和rowcount
$dbh = new PDO("mysql:host=localhost;dbname=databasename", "user", "pass");
$stmt = $dbh->prepare("SELECT * FROM `something` WHERE `email`=':email' and `name`=':name'");
$stmt->bindParam(':email', '[email protected]',PDO::PARAM_STR);
$stmt->bindParam(':name', 'name',PDO::PARAM_INT);
$stmt->execute();
if($stmt->rowCount() == 1)
{
echo "row count 1";
}
else if ($stmt->rowCount() == 0)
{
echo "row count 0";
}
else if ($stmt->rowCount() > 1)
{
echo "row count greater then 1";
}
日Thnx !!!!! :)它總是那些st ** pid d * mnn報價:) – hexedecimal 2015-02-09 09:55:22