iOS, Swift, SqLite, Select and show all the rows -
i have sqlite database. use fmdb. how select , show rows of database selected?. in code can show first name, first row. how iterate through rows selected , show them swift?
@ibaction func selectnoms(sender: anyobject) { let contactdb = fmdatabase(path: databasepath string) if contactdb.open() { let querysql = "select name contacts" let results:fmresultset? = contactdb.executequery(querysql, withargumentsinarray: nil) if results?.next() == true { status.text = results?.stringforcolumn("name") } contactdb.close() } else { println("error: \(contactdb.lasterrormessage())") } }
you can try this:
while results.next() { status.text = results.stringforcolumn("name")
}
Comments
Post a Comment