During the new user registration process, I\'m trying to find whether a user name or a user email are already in the db. To do that, I want to find the number of rows where
You could use ->fetchColumn(0) to get the 1 and only column from the next (one and only) rowset.
if ( $query->fetchColumn(0) > 0 ){
return false;
} else return true;
(Note: I haven't tested this, nor do I have PHP installed on my work machine to test it; I work in a C#/Java shop)
Likely, you'd want $query->fetchColumn();
You can also pass which column number you want, but it defaults to column 0.