mcorega / MySqlSwiftNative

MySQL Swift Native Driver
Other
112 stars 44 forks source link

What am i doing wroug #5

Closed ourweb4 closed 8 years ago

ourweb4 commented 8 years ago
func loadmembers() {
  let user_id = userdata.user_id
    if user_id != 0 {
        memberlist.removeAll()
        opendb()
        do {
            var table = MySQL.Table(tableName:"members", connection:conn)
            // select all rows from the table given a condition
             var rows = try table.select(Where: ["user_id=",user_id])

            for var i = 0; i < rows!.count; i++ {

                var row = rows

                let member_id = (row["member_id"] as UInt)

                let optin = row["optin"] as? UInt
                let name = row["name"] as? String
                let cell = (row["cell"] as? String)!

                let addmember = members(member_id: member_id, user_id: user_id, name: name, cell: cell, opin: optin)

                memberlist.append(addmember)
              //  }
            }

        }
         catch (let err as NSError) {
           print(err.debugDescription)

        }
        closedb()
        tableview.reloadData()
    }

}
mcorega commented 8 years ago

are you using the latest sources from github? releases are older.

ourweb4 commented 8 years ago

pods

ourweb4 commented 8 years ago

https://github.com/ourweb4/smsrealtor.git

mcorega commented 8 years ago

copy the contents of Sources/MySqlSwiftNative/ to your project, delete the pods dependencies - they are old, and it should work

ourweb4 commented 8 years ago

ok how

ourweb4 commented 8 years ago

same problem

mcorega commented 8 years ago

made some changes to your code, added the missing files. I also attached a zip containing the project which builds on my system. smsrealtor.zip

ourweb4 commented 8 years ago

thanks