找回密码
 加入
搜索
查看: 2332|回复: 0

[网络通信] 求助 哪里错了?MYSQL连接问题

[复制链接]
发表于 2010-4-6 13:20:04 | 显示全部楼层 |阅读模式
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <mysql.au3>
#include <array.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 447, 192, 124)
$ListView1 = GUICtrlCreateListView("姓名|联系电话|传真|EMAIL|地址|单位|反馈内容|时间", 8, 16, 609, 353)
$Button1 = GUICtrlCreateButton("读取反馈", 240, 392, 129, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
_MySQL_InitLibrary()
If @error Then Exit MsgBox(0, '', "")
$MysqlConn = _MySQL_Init()
$connected = _MySQL_Real_Connect($MysqlConn, "0.0.0.0", "aaa", "sss3", "zsq1d1_db")
If $connected = 0 Then Exit MsgBox(16, 'Connection Error', _MySQL_Error($MysqlConn))
$query = 'SELECT name, contactPhone, contactFax, contactEmail, address, company feedBackContent, feedBackContent FROM feedback ORDER BY feedBackID';DESC"
_MySQL_Real_Query($MysqlConn, $query)
$res = _MySQL_Store_Result($MysqlConn)

$fields = _MySQL_Num_Fields($res)
$rows = _MySQL_Num_Rows($res)

$array = _MySQL_Fetch_Result_StringArray($res)
_ArrayDisplay($array)

; fieldinfomation
MsgBox(0, '', "Access fieldinformation")
Dim $arFields[$fields][3]
For $i = 0 To $fields - 1
    $field = _MySQL_Fetch_Field_Direct($res, $i)
    $arFields[$i][0] = _MySQL_Field_ReadValue($field, "name")
    $arFields[$i][1] = _MySQL_Field_ReadValue($field, "contactPhone")
    $arFields[$i][2] = _MySQL_Field_ReadValue($field, "contactFax")
        $arFields[$i][3] = _MySQL_Field_ReadValue($field, "contactEmail")
    $arFields[$i][4] = _MySQL_Field_ReadValue($field, "address")
    $arFields[$i][5] = _MySQL_Field_ReadValue($field, "company feedBackContent")
        $arFields[$i][6] = _MySQL_Field_ReadValue($field, "feedBackContent")
Next
MsgBox(0,"","")
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd

今天刚刚接触MYSQL的UDF 不是很会用啊
上面代码运行后就没什么提示自动退出了
帮忙给看一下
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-11-16 15:46 , Processed in 0.079784 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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