does anyone know how to return the count of a query when using FMDB? If I executeQuery @\"select count(*) from sometable were...\" I get an empty FMResultSet back. How can I get
Please Try Following Code, this works for me
let objManager = ModelManager.getInstance()
objManager.database?.open()
let resultSet1: FMResultSet! = sharedInstance.database!.executeQuery("SELECT COUNT(Field) FROM TableName”, withArgumentsInArray:nil)
if (resultSet1 != nil)
{
while resultSet1.next()
{
countRecord = Int(resultSet1.intForColumn("COUNT(Field)"))
}
}
print(countRecord)
You Will get Count of Field