提交 bf7faf04 编写于 作者: A astaxie

修复sqlite插入语法

上级 dd651ef2
......@@ -43,7 +43,7 @@ Go支持sqlite的驱动也比较多,但是好多都是不支持database/sql接
checkErr(err)
//插入数据
stmt, err := db.Prepare("INSERT userinfo SET username=?,departname=?,created=?")
stmt, err := db.Prepare("INSERT INTO userinfo(username, departname, created) values(?,?,?)")
checkErr(err)
res, err := stmt.Exec("astaxie", "研发部门", "2012-12-09")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册