Mysql api调用

yjgyjgg 2021-12-16 11953

  #include "mysql/MySql.bi"

   Dim conn as MySql ptr
   Dim res  As MYSQL_RES Ptr
   Dim row  as MYSQL_ROW
   conn = mysql_init(null)
   If conn = null Then
      Debug.Print "初始化失败"
      Exit sub
   End If
   if mysql_real_connect(conn ,"localhost" ,"root" ,"usbw" ,"test" ,3307 ,"" ,0) = NULL Then
      Debug.Print "连接失败"
      Exit sub
   End If
   if mysql_query(conn ,"show tables") <> 0 Then
      Debug.Print *mysql_error(conn)
   End If
   res = mysql_use_result(conn)
   If res = NULL Then
      Debug.Print *mysql_error(conn)
   End If
   ''Debug.Print mysql_num_rows(res)
   Do
      row = mysql_fetch_row(res)
      If row = NULL Then Exit Do
      Dim s as ZString Ptr ptr = row
      Debug.Print s[0][0]
   Loop
   mysql_free_result(res)
   mysql_close(conn)

因国家互联网安全管理要求,关闭回帖功能。大家需要留言,请使用【勇芳软件客服】即时联系勇芳点此打开->>勇芳软件客服
返回
联系勇芳
发新帖 搜索 反馈 回顶部