snowboardr
Programmer
I have a query which returns X rows, how do i get the number X in asp after running the query but before printing out the rows.
I attempted to do a count statement before hand, but there is no non-aggregate columns to do group by so thus the count is always innacurate. (mysql database)
ps. I did attempt to ask my question in MySQL, but I was sent here ( thread436-1203178 )
I attempted to do a count statement before hand, but there is no non-aggregate columns to do group by so thus the count is always innacurate. (mysql database)
ps. I did attempt to ask my question in MySQL, but I was sent here ( thread436-1203178 )
Code:
sql= "SELECT "_
& "COUNT(post.pid) as PostCount,"_
& "post.ptid,"_
& "post.ptid2,"_
& "post.puid,"_
& "post.psubject,"_
& "post.pbody,"_
& "post.ptype,"_
& "post.preplycount,"_
& "post.ptime,"_
& "post.psticky,"_
& "post.ptimereply,"_
& "user.uid,"_
& "user.uname,"_
& "MATCH(psubject,pbody,uname) AGAINST ('+" & qsearch & "' in boolean mode)" _
& " FROM forumpost as post join users user on user.uid=post.puid WHERE MATCH(psubject,pbody,uname) AGAINST ('" & qsearch & "' in boolean mode) group by user.uid"