PDO, fetched rows and the fastest way...
Posted: Wed Apr 05, 2006 9:34 am
I have a SELECT query that get one or more rows from a large table. The script must do different things if the result is either 0, 1 or 2 and more rows. I'm using PDO and is has no function like mysql_num_rows() ... what must I do then?
I thought about running a second query with COUNT(*), but is that efficient? Or is it better to do a count(fetchAll())?
Does anybody know the best way to do it?
/Asger
I thought about running a second query with COUNT(*), but is that efficient? Or is it better to do a count(fetchAll())?
Does anybody know the best way to do it?
/Asger