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

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -