zxtnt09 Posted September 15, 2015 Share Posted September 15, 2015 hi guys, for first sorry for my lot questions,how can i read all "id , name ,etc" and return that to msgbox.for example : 1 ) i have a mysql database and have this table and columns : table : userinfocolumns : ID , username , password , email ,etc.2 ) now i want to return something like that in msgbox : ID : 1 , Username : 1ID : 2 , Username : 2ID : 3 , Username : 3...-* i have mysql database , and i was connect my program to database and all of thing is true , but i don't know how can i fix this issue thanks all Link to comment Share on other sites More sharing options...
Radiance Posted September 15, 2015 Share Posted September 15, 2015 What you get back with the code below is a 2D-Array.Using a loop you can pack all the contents the select returns into a Message Box, #include <Array.au3> Global $Driver = "" Global $Server = "" Global $DB = "" GLobal $User = "" Global $Pwd = "" Global $Port = "" Global $Select = "select * from table" Global $RecordSet, $Data Global $Connection = ObjCreate("ADODB.Connection") $Connection.open ("DRIVER=" & $Driver & ";SERVER=" & $Server & ";DATABASE=" & $DB & ";UID=" & $User & ";PWD=" & $Pwd & ";PORT=" & $Port) If @error Then MsgBox(16, "Fail", "Couldn't connect to database") Exit EndIf $RecordSet = $Connection.Execute($Select) If @error Then MsgBox(16, "Fail", "Failed to execute query.") Exit EndIf $Data = $RecordSet.GetRows If @error Then MsgBox(16, "Fail", "Failed to get rows or empty set.") Exit EndIf _ArrayDisplay($Data) Link to comment Share on other sites More sharing options...
Celtic88 Posted September 15, 2015 Share Posted September 15, 2015 columns : ID , username , password , email ,etc. Link to comment Share on other sites More sharing options...
zxtnt09 Posted September 15, 2015 Author Share Posted September 15, 2015 What you get back with the code below is a 2D-Array.Using a loop you can pack all the contents the select returns into a Message Box, #include <Array.au3> Global $Driver = "" Global $Server = "" Global $DB = "" GLobal $User = "" Global $Pwd = "" Global $Port = "" Global $Select = "select * from table" Global $RecordSet, $Data Global $Connection = ObjCreate("ADODB.Connection") $Connection.open ("DRIVER=" & $Driver & ";SERVER=" & $Server & ";DATABASE=" & $DB & ";UID=" & $User & ";PWD=" & $Pwd & ";PORT=" & $Port) If @error Then MsgBox(16, "Fail", "Couldn't connect to database") Exit EndIf $RecordSet = $Connection.Execute($Select) If @error Then MsgBox(16, "Fail", "Failed to execute query.") Exit EndIf $Data = $RecordSet.GetRows If @error Then MsgBox(16, "Fail", "Failed to get rows or empty set.") Exit EndIf _ArrayDisplay($Data) Thanks it's very useful columns : ID , username , password , email ,etc. Very funny =)))) ,And no, it is just for members. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now