Jump to content

Assign each value from an Array queried from a database table to each variables


Recommended Posts

Dear all,

Currently, I am running a _EzMySql_GetTable2d function below 

$result = _EzMySql_GetTable2d("select externalID,locationName,street1,city from orders where Id ='1113602'")

_ArrayDisplay($result)

and this is what I got 

image.png.cf82cddd0321c9a0a27aaeff7af0d59b.png

My question is that how would I able to assign the results above to the following variables 

Local $Ref = the result from Col 0, Row1

Local $Euname = the result from Col 1, Row1

Local $street = the result from Col 2, Row1

Local $city = the result from Col3, Row1

Your help is greatly appreciated! Thank you. 

Link to post
Share on other sites

Hi PnD,
I would go on something like this :

$result = _EzMySql_GetTable2d("select externalID,locationName,street1,city from orders where Id ='1113602'")

Local $iRet = _ArrayDisplay($result)

If $iRet And Ubound($result) > 1 Then
    Local $Ref = $result[1][0]
    Local $Euname = $result[1][1]
    Local $street = $result[1][2]
    Local $city = $result[1][3]
EndIf

Maybe also check the Array got 2 dimensions and 4 columns (in case you won't always use _ArrayDisplay)

Link to post
Share on other sites

But the real question is why do you need to assign array result to simple variables ?  I do not think it is necessary as you can access to individual cell by specifying its indexes.  Make sure you understand arrays before spending lots of time creating variables uselessly. 

Link to post
Share on other sites

@PnD :welcome: to logo_autoit_210x72.svg forum.

Why to assign variables at all ?
Did you found what Enum are for ?

_Example()

Func _Example()
    Local Enum _
            $_COMMONNAME_C0_externalID, _
            $_COMMONNAME_C1_locationName, _
            $_COMMONNAME_C2_steet1, _
            $_COMMONNAME_C3_city, _
            $_COMMONNAME_MAX
            
    Local $a_Locations = _EzMySql_GetTable2d("select externalID,locationName,street1,city from orders where Id ='1113602'")
    _ArrayDisplay($a_Locations)
    For $i_row_idx =1 To UBound($a_Locations) -1
        If StringInStr($a_Locations[$i_row_idx][$_COMMONNAME_C1_locationName], 'Christopher') Then
            ConsoleWrite($a_Locations[$i_row_idx][$_COMMONNAME_C0_externalID] & @CRLF)
            ConsoleWrite($a_Locations[$i_row_idx][$_COMMONNAME_C1_locationName] & @CRLF)
            ConsoleWrite($a_Locations[$i_row_idx][$_COMMONNAME_C2_steet1] & @CRLF)
            ConsoleWrite($a_Locations[$i_row_idx][$_COMMONNAME_C3_city] & @CRLF)
            
        EndIf
    Next
    
EndFunc

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * for other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2021-10-18

Link to post
Share on other sites

Hi PixelSearch, Nine and MLipok,

Thank you so much for your quick reply and provided solutions. The reason that I choose to assign the results to variables so that I can parse those variable to  matched fields on a html file so later I can print that html out (such as Label which has Eu's name, address and so on)

From mLipok's solution, i have modify it to be

    Local Enum _
            $_COMMONNAME_C0_externalID, _
            $_COMMONNAME_C1_locationName, _
            $_COMMONNAME_C2_steet1, _
            $_COMMONNAME_C3_city, _
            $_COMMONNAME_MAX

    Local $a_Locations = _EzMySql_GetTable2d("select externalID,locationName,street1,city from orders where Id ='1113602'")
    _ArrayDisplay($a_Locations)
    For $i_row_idx =1 To UBound($a_Locations) -1
            local $Ref= ($a_Locations[$i_row_idx][$_COMMONNAME_C0_externalID])
            local $Euname=($a_Locations[$i_row_idx][$_COMMONNAME_C1_locationName])
            local $street= ($a_Locations[$i_row_idx][$_COMMONNAME_C2_steet1])
            local $city= ($a_Locations[$i_row_idx][$_COMMONNAME_C3_city])
    Next

MsgBox($MB_SYSTEMMODAL, "Here we go", $Ref& @CRLF & $Euname &@CRLF & $street & @CRLF & $city)

and it works great!

From PixelSearch's solution, it also works perfectly as well

If $iRet And Ubound($result) > 1 Then
    Local $Ref = $result[1][0]
    Local $Euname = $result[1][1]
    Local $street = $result[1][2]
    Local $city = $result[1][3]
EndIf
MsgBox($MB_SYSTEMMODAL, "Here we go", $Ref& @CRLF & $Euname &@CRLF & $street & @CRLF & $city)

 

Nine is absolutely right. I do not have to assign the value to a variable. Instead, just simply parse $result[1][0], and so on to any field I want to replace in that html file.

However, is it helpful and convenience just to assign Global variables to those values so that we can use those variables for others functions instead of just using $result[1][0], and so on without knowing unique names?

I also have a follow up question since it involves array. Would you please recommend any solutions to shorten the codes below to make it works faster

(I have to filedelete first because filewire only append write)

Local $html = FileRead(@ScriptDir & "\Ship LabelV2.html")
    Local $new_html = StringReplace($html,"EUNAME#",$EUName)
    Local $new_html1= StringReplace($new_html,"#ITIorder#",$ITIOrder)
    Local $new_html2 = StringReplace($new_html1,"#Model#",$TVModel)
    Local $new_html3 = StringReplace ($new_html2,"#Ref#",$ITIRef)
    Local $new_html4 = StringReplace ($new_html3,"#Serial#",$Input1)
    Local $new_html5 = StringReplace ($new_html4,"#Sale#",$Input)

    FileDelete(@ScriptDir & "\Ship LabelV3.html")
    FileWrite(@ScriptDir & "\Ship LabelV3.html",$new_html5)

 

 

 

 

 

 

 

 

Link to post
Share on other sites

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * for other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2021-10-18

Link to post
Share on other sites

as to your code
Why do you use brackets in this part:

Local $Ref= ($a_Locations[$i_row_idx][$_COMMONNAME_C0_externalID])

I mean instead such form:

Local $Ref= $a_Locations[$i_row_idx][$_COMMONNAME_C0_externalID]

?

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * for other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2021-10-18

Link to post
Share on other sites

Hi mLipok,

Thank you for your instruction. I have just repost my quote here as I could not find any edit button from my previous response. If you have the admin right, please help me delete it.

Hi PixelSearch, Nine and MLipok,

Thank you so much for your quick reply and provided solutions. The reason that I choose to assign the results to variables so that I can parse those variable to  matched fields on a html file so later I can print that html out (such as Label which has Eu's name, address and so on)

From mLipok's solution, i have modify it to be

Local Enum _
            $_COMMONNAME_C0_externalID, _
            $_COMMONNAME_C1_locationName, _
            $_COMMONNAME_C2_steet1, _
            $_COMMONNAME_C3_city, _
            $_COMMONNAME_MAX

    Local $a_Locations = _EzMySql_GetTable2d("select externalID,locationName,street1,city from orders where Id ='1113602'")
    _ArrayDisplay($a_Locations)
    
    ; Bracket Removed as typo from previous post.
    
    For $i_row_idx =1 To UBound($a_Locations) -1
            local $Ref= $a_Locations[$i_row_idx][$_COMMONNAME_C0_externalID]
            local $Euname=$a_Locations[$i_row_idx][$_COMMONNAME_C1_locationName]
            local $street= $a_Locations[$i_row_idx][$_COMMONNAME_C2_steet1]
            local $city= $a_Locations[$i_row_idx][$_COMMONNAME_C3_city]
    Next

From PixelSearch's solution, it also works perfectly as well

If $iRet And Ubound($result) > 1 Then
    Local $Ref = $result[1][0]
    Local $Euname = $result[1][1]
    Local $street = $result[1][2]
    Local $city = $result[1][3]
EndIf
MsgBox($MB_SYSTEMMODAL, "Here we go", $Ref& @CRLF & $Euname &@CRLF & $street & @CRLF & $city)

Nine is absolutely right. I do not have to assign the value to a variable. Instead, just simply parse $result[1][0], and so on to any field I want to replace in that html file.

However, is it helpful and convenience just to assign Global variables to those values so that we can use those variables for others functions instead of just using $result[1][0], and so on without knowing unique names?

I also have a follow up question since it involves array. Would you please recommend any solutions to shorten the codes below to make it works faster

(I have to filedelete first because filewire only append write)

Local $html = FileRead(@ScriptDir & "\Ship LabelV2.html")
    Local $new_html = StringReplace($html,"EUNAME#",$EUName)
    Local $new_html1= StringReplace($new_html,"#ITIorder#",$ITIOrder)
    Local $new_html2 = StringReplace($new_html1,"#Model#",$TVModel)
    Local $new_html3 = StringReplace ($new_html2,"#Ref#",$ITIRef)
    Local $new_html4 = StringReplace ($new_html3,"#Serial#",$Input1)
    Local $new_html5 = StringReplace ($new_html4,"#Sale#",$Input)

    FileDelete(@ScriptDir & "\Ship LabelV3.html")
    FileWrite(@ScriptDir & "\Ship LabelV3.html",$new_html5)

 

Link to post
Share on other sites
30 minutes ago, PnD said:

Thank you for your instruction. I have just repost my quote here as I could not find any edit button from my previous response. If you have the admin right, please help me delete it.

HowTo_EditPost1.png

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * for other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2021-10-18

Link to post
Share on other sites
32 minutes ago, PnD said:

Nine is absolutely right. I do not have to assign the value to a variable. Instead, just simply parse $result[1][0], and so on to any field I want to replace in that html file.

However, is it helpful and convenience just to assign Global variables to those values so that we can use those variables for others functions instead of just using $result[1][0], and so on without knowing unique names?

this is called MAGIC NUMBER

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * for other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2021-10-18

Link to post
Share on other sites
On 4/12/2021 at 3:51 PM, PnD said:

$result = _EzMySql_GetTable2d("select externalID,locationName,street1,city from orders where Id ='1113602'")

_ArrayDisplay($result)

and this is what I got 

image.png.cf82cddd0321c9a0a27aaeff7af0d59b.png

Question, why are the column names returned in row 0?

Code hard, but don’t hard code...

Link to post
Share on other sites
On 4/13/2021 at 6:05 PM, JockoDundee said:

Question, why are the column names returned in row 0?

I really have no idea. That's exactly what I got from the query's result.

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...