Having built a work around for the counting feature not working, in any of the normal ways Ihave the following problem.
This works perfectly:
RSPage = TRIM(Request.QueryString("page"))
If Len(RSPage) = 0 Then RSPage = 1
Max = 10
If RSPage = 1 Then Offset = 0
If RSPage > 1 Then Offset = (RSPage-1) * Max
Set CConn = Server.CreateObject("ADODB.Connection")
Set CRs = Server.CreateObject("ADODB.RecordSet")
CRs.Open "SELECT COUNT(*) AS PAGECOUNT FROM tblsearch WHERE Active=-1 AND Reference=" & strRefLink, CConn
TotalRecords = CRs("PAGECOUNT")
If (Round((TotalRecords/Max))) = Round((TotalRecords/Max),2) Then
TotalPages = Round((TotalRecords/Max),2)
TotalPages = Round((TotalRecords/Max)+1)
If Not CInt(TotalPages) = CInt(RSPage) Then
If TotalRecords < Max Then
PageSwitch = False
PageSwitch = True
I also need it to work with the following SQL but have failed in all attempts so far.
"SELECT *, MATCH (url,description,name) AGAINST ('" & Search & "' IN BOOLEAN MODE) AS score FROM tblsearch WHERE Active=-1 AND MATCH (url,description,name) AGAINST ('" & Search & "' IN BOOLEAN MODE) ORDER BY name ASC LIMIT " & Offset & "," & Max
The MATCH command seems to be causing a problem when combined with the COUNT(*) feature,
The String above works fine on its own, but not with COUNT(*).
Can anyone help? :rolleyes: