I'm trying to make the PDO query below working, but somehow it doesn't. This is how far i mine brain exploded! Is there somebody who can say what i'm doint wrong?
$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"; }