找回密码
 加入
搜索
查看: 19138|回复: 27

[AU3基础] au3 如何操作Mysql 【已解决】

 火... [复制链接]
发表于 2010-6-4 20:26:21 | 显示全部楼层 |阅读模式
本帖最后由 haodd 于 2010-11-12 23:24 编辑

如题!

百度 google   

!~~           没有心仪的答案

help文件也没有

把数据写到  mysql  已创建的数据库  数据表中

谢谢!

评分

参与人数 1金钱 +10 收起 理由
afan + 10 感谢主动将修改帖子分类为[已解决],请继续 ...

查看全部评分

 楼主| 发表于 2010-6-4 22:05:27 | 显示全部楼层
#include <array.au3>
#include "mysql.au3"
__MySQL_ExtractEmbeddedDLL()
_MySQL_InitLibrary()

$MysqlConn = _MySQL_Init()
;方法1 开始
;$connected = _MySQL_Real_Connect($MysqlConn,"localhost","root","asdf1234","gmsj")
;If $connected = 0 Then
;        $errno = _MySQL_errno($MysqlConn)
;        MsgBox(0,"Error:",$errno & @LF & _MySQL_error($MysqlConn))
;        If $errno = $CR_UNKNOWN_HOST Then MsgBox(0,"Error:","$CR_UNKNOWN_HOST" & @LF & $CR_UNKNOWN_HOST)
;Endif
;MsgBox(0, "sda", "ok")
;方法1 结束
$connected = _MySQL_Real_Connect($MysqlConn, "127.0.0.1", "root", "sssss", "data")
; _MySQL_Real_Connect($MysqlConn,"服务器IP","账户","密码","数据库名称")

If $connected = 0 Then Exit MsgBox(16, 'Connection Error', _MySQL_Error($MysqlConn))
$query = "SELECT * FROM CHARACTER_SETS"
_MySQL_Real_Query($MysqlConn, $query)
$res = _MySQL_Store_Result($MysqlConn)
$fields = _MySQL_Num_Fields($res)
$rows = _MySQL_Num_Rows($res)
MsgBox(0, "data","row:"&$rows & "-" & $fields&"ok")

评分

参与人数 1金钱 +15 收起 理由
afan + 15

查看全部评分

 楼主| 发表于 2010-6-4 22:06:45 | 显示全部楼层
以上 本人亲测 可以连接  查询!
发表于 2010-6-27 16:14:46 | 显示全部楼层
回复 2# haodd


    不能打开"mysql.au3",呵呵
发表于 2010-10-18 18:35:08 | 显示全部楼层
來學習的~ 謝謝
发表于 2010-11-23 09:55:58 | 显示全部楼层
保存了 谢谢
发表于 2011-8-1 13:40:44 | 显示全部楼层
看看是不是我要的。。。
发表于 2011-11-14 20:05:19 | 显示全部楼层
好东西啊。存起来先。
发表于 2011-12-2 09:52:42 | 显示全部楼层
mysql.au3是用户函数UDF,你需要拷贝到UserInclude下,然后include才行。
发表于 2012-6-9 15:48:05 | 显示全部楼层
保存了 谢谢
发表于 2012-9-17 16:26:08 | 显示全部楼层
good
发表于 2012-10-24 21:20:15 | 显示全部楼层
留个脚印,学习。。。。。。。。。。。。。。
发表于 2012-11-13 13:16:30 | 显示全部楼层
发表于 2012-11-16 11:57:52 | 显示全部楼层
为啥mysql'的操作看着都很痛苦呢
发表于 2013-6-5 09:31:04 | 显示全部楼层
本帖最后由 ac5474012 于 2013-6-5 09:34 编辑

报错:
"C:\Documents and Settings\guoji\My Documents\1.au3"(3,27) : error: _MySQL_ExtractEmbeddedDLL(): 未定义的函数.
_MySQL_ExtractEmbeddedDLL()
~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\guoji\My Documents\1.au3 - 1 错误, 0 警告
我放入了支持
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-16 15:39 , Processed in 0.090126 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表