PDOStatement::rowCount

prepare( $query );
$stmt->execute( array( $col1, $col2 ) );
print $stmt->rowCount();

echo "\n\n";

$con = null;
$database = "AdventureWorks";
$conn = new PDO( "sqlsrv:server=$server ; Database = $database", "", "");

$query = "select * from Person.ContactType";
$stmt = $conn->prepare( $query, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));
$stmt->execute();
print $stmt->rowCount();
?>
 
http://msdn.microsoft.com/en-us/library/ff628154%28v=sql.105%29 
Related Posts with Thumbnails