#Region Includes #include <Array.au3> #include <MySQL.au3> #EndRegion Includes #NoTrayIcon Global $sDBServer = "localhost" Global $sDBUserName = "User", $sDBPassword = "password" Global $sDatabase = "TestDB", $sTblTest = "Test" Global $MySQLConn = _MySQLConnect($sDBUserName, $sDBPassword, $sDatabase, $sDBServer, "{MySQL ODBC 5.1 Driver}") ; Создаем Таблицу Test _CreateTable($MySQLConn, "Test", "ID", "INTEGER", "yes", "yes", "MyISAM") ; Создаем Колонки _CreateColumn($MySQLConn, "Test", "First_Name", "yes", "VARCHAR(10)") _CreateColumn($MySQLConn, "Test", "Last_Name", "yes", "VARCHAR(10)") _CreateColumn($MySQLConn, "Test", "Telephone", "yes", "INT(10)", "no", "no", 0) ; Добавляем записи _AddRecord($MySQLConn, "Test", "First_Name, Last_Name, Telephone", "John', 'Smith', '35557867") _AddRecord($MySQLConn, "Test", "First_Name, Last_Name, Telephone", "Luke','Black','35557812") $iRecordCount = _CountRecords($MySQLConn, "Test", "ID") $aColumnNames = _GetColNames($MySQLConn, "Test") ; _GetColCount($MySQLConn, "Test") Dim $aRecordValue[$iRecordCount + 1][$aColumnNames[0]] = [[$iRecordCount]] For $c = 1 To $aColumnNames[0] $aColumnValue = _GetColVals($MySQLConn, "Test", $aColumnNames[$c]) For $r = 1 To $aColumnValue[0] $aRecordValue[$r][$c - 1] = $aColumnValue[$r] Next Next _ArrayDisplay($aRecordValue) _MySQLEnd($MySQLConn) |