-
1. Re: What's wrong with my SELECT/COUNT(*) statement?
bregent Feb 7, 2013 10:08 PM (in response to matthew stuart)>"SELECT *, COUNT(*) AS countTOT FROM tbl_forumPOSTS WHERE....
That SQL is not valid - at least not by SQL standards. If your query contains an aggregate, then all columns that are not aggregated must be in a group by clause. It's possible that MySQL implicitly adds all non-aggreated columns to a group by, but you should probably fix it anyway. If you don't need to use the other columns from that table in the recordset, then just remove the * from the select list.
"SELECT COUNT(*) AS countTOT FROM tbl_forumPOSTS WHERE....
If you still have a problem, then output the value in $totalRows_rs_replycount to see if you are getting any rows returned from your query.
Next, comment out these lines:
if (isset($_GET['trcount'])) {
$threadreplys_rs_replycount = $_GET['trcount'];
to make sure any value in trcount is not interfering with the default value of '3' and see if that returns any results.



