Nitin Pratap Singh wrote:
>
>
>
> Hello Friends,
>
> I need some help in PDO.
>
> What is the equivalent of "mysql_num_rows() or $rsmt->num_rows" in PDO.
>
> >From where I can pick simple tutorial for basic level use of PDO.
>
> Kindly help/guide me.
>
> Thanks,
>
> Nitin Pratap Singh
>
I'm not sure if it's the "correct" way to do it, but here you go:
After running your query, do something like this:
$count = $db->prepare('SELECT found_rows() AS count');
$count->execute();
$rows_array = $count->fetch(PDO::FETCH_NUM);
$count->closeCursor();
$rows = $rows_array[0];