ok...
select count(1) or select count(*) returns the same number of rows. 1 just means to use column 1 for the count.
THe connection has already been established.
THere is no need for a where or a group. It's just excess SQL processing that is unneccessary.
THe SQL is fine, it's the function that is wrong.
I have also tried the return statement instead of printing. Same deal.
Any other thoughts?