我的应用程序中有3个文本字段,如下所示:
我想使用<a class="play-button" href="#" data-toggle="modal" data-target="#videoModal" data-theVideo="someVideo.mp4"><div class="play-button"></div></a>
MySQL
数据库
答案 0 :(得分:2)
您想要在外部连接MySql Server还是在我的本地SQL数据库
以下是使用此库的方法 https://github.com/novi/mysql-swift
如何建立连接
let options = Options(host: "db.example.tokyo"...)
let pool = ConnectionPool(options: options)
let conn = try pool.getConnection()
conn.query("SELECT 1 + 2;")
conn.release()
如何从数据库中获取数据
let rows: [User] = try pool.execute { conn in
// The connection is held in this block
try conn.query("SELECT * FROM users;") // And also it returns result to outside execute block
}
有关更多信息,请参阅此处的库文档