Database related problem(s)

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by anil.

Hi,

This is what I want to do. I want to find the total records returned by a query. Is there any shortcut way to find that out? Currently I am using a While NextDatabaseRow()...Wend loop to run a counter to find that out. But the problem here is I am unable to reverse the pointer back to the first record after this loop has finished. I tried the PreviousDatabaseRow command but it was not working after this. Anyone has any ideas?

Thanks,
Anil
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by woki.

Hi,

use the SQL statement "select count(*) as totalrecs from TABLE where QUERY" with DatabaseQuery(Request$). Totalrec is a column alias.

Greetings
woki
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by woki.

Hi,

use the SQL statement "select count(*) as totalrecs from TABLE where QUERY" with DatabaseQuery(Request$). Totalrec is a column alias.

Greetings
woki
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by anil.

yes, that is a shorter method indeed. Thanks!
Post Reply