PDO rowCount() works on MySQL but not in SQL Server 2008 R2
I have a problem when I get number of rows in SQL Server 2008 because my code works fine using MySQL but not in SQL Server. $sql = "SELECT TOP 1 U.Id , U.Name, U.Profile, P.Name NameProfile FROM sa_users U INNER JOIN sa_profiles P ON P.Id = U.Profile WHERE User = :user AND Pass = :pass"; $result = $this->dbConnect->prepare($sql) or die ($sql); $result->bindParam(':user',$this->data['username'],PDO::PARAM_STR); $result->bindParam(':pass',$this->data['password'],PDO::PARAM_STR); if (!$result->execute()) { return false; } $numrows = $result->rowCount(); $jsonLogin = array(); var_dump($numrows);