Recordcount

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 Bernard.

I'am looking for how to get the recordcount after a DataBaseQuery

Thanks for yours answers

BDu
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 Fangbeast.

id is the record number in database
mydata is the table

Code: Select all


  qry.s = "Select Count(id) as totalrecs from mydata;"
  
  If DatabaseQuery(qry.s)
    While NextDatabaseRow()
      totalrecords = 0
      totalrecords = GetDatabaseLong(0)
    Wend
  EndIf


We are Dyslexic of Borg, prepare to have your ass laminated!
Post Reply