mcorega/MySqlSwiftNative

MySQL.Table xcode error

Closed this issue · 0 comments

  opendb()
        do {

// error here/Users/ourweb/Desktop/my code/smsrealtors/smsrealtors/ViewController.swift:37:35: //'MySQL.Table' cannot be constructed because it has no accessible initializers

            let table = MySQL.Table(tableName:"members", connection:conn)
            // select all rows from the table given a condition
             let rows = try table.select(Where: ["user_id=",user_id])

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

                if let row = rows?[i] {

                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()