本帖最后由 nop 于 2011-12-2 23:50 编辑
添加记录,如果用常量就可以,变量就不行了, '"+$vv+"'是不是格式错了?#include <array.au3>
#include "mysql.au3"
; MYSQL starten, DLL im PATH (enth鋖t auch @ScriptDir), sont Pfad zur DLL angeben. DLL muss libmysql.dll hei遝n.
_MySQL_InitLibrary()
$MysqlConn = _MySQL_Init()
$connected = _MySQL_Real_Connect($MysqlConn, "111.com", "root", "333", "test")
If $connected = 0 Then Exit MsgBox(16, 'Connection Error', _MySQL_Error($MysqlConn))
Dim $vv = "bb";
MsgBox(1,"",$vv )
$query1 = "INSERT INTO s (pc,email) VALUES ('AAAAA-23','"+$vv+"')";
_MySQL_Real_Query($connected, $query1)
$query = "SELECT * FROM s"
_MySQL_Real_Query($connected, $query)
$res = _MySQL_Store_Result($MysqlConn)
$array = _MySQL_Fetch_Result_StringArray($res)
_ArrayDisplay($array)
; Abfrage freigeben
_MySQL_Free_Result($res)
; Verbindung beenden
_MySQL_Close($MysqlConn)
; MYSQL beenden
_MySQL_EndLibrary()
|