myql操作
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
419 B

  1. package tencentdb
  2. import (
  3. "testing"
  4. )
  5. func Test_StmtForExec(t *testing.T) {
  6. Connect("127.0.0.1", "root", "123456", "tetele_empty", "3306")
  7. stmt, err := StmtForUpdate("dev_tetele_net", "ttl_xshop_order", []string{"user_id = ?", "pay_time = pay_time+1"}, []string{"id=1"})
  8. if err != nil {
  9. t.Error(err)
  10. }
  11. defer stmt.Close()
  12. ret, err := StmtForUpdateExec(stmt, []interface{}{"1"})
  13. t.Log(ret)
  14. t.Log(err)
  15. }