Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

mysql ez simplification

$
0
0

hello, im trying to simplify this code

AutoIt         
Case $button10             Local $sMySqlStatement = ""             $aOk = _EzMySql_GetTable2d("SELECT * FROM " & GUICtrlRead($Input2) & ";")             Local $rows = UBound($aOk)             If GUICtrlRead($Input12) > $rows Then                 MsgBox(0, "error", "exede rows bd: " & $rows & "leido: " & GUICtrlRead($Input12) )             Else                 $aOk = _EzMySql_GetTable2d("SELECT * FROM " & GUICtrlRead($Input2) & " WHERE RowID = " & "'" & GUICtrlRead($Input12) & "';")                 $error = @error                 If Not IsArray($aOk) Then                     MsgBox(0, $sMySqlStatement & " error", $error)                 Else                     GUICtrlSetData($Input10, $aOk[1][1])                     GUICtrlSetData($Input11, $aOk[1][2])                     GUICtrlSetData($Input12, $aOk[1][3])                 EndIf             EndIf             Local $rows = UBound($aOk)             Local $cols = UBound($aOk, 2)             Local $dims = UBound($aOk, 0)             MsgBox(0, "The " & $dims & "-dimensional array has", _                     $rows & " rows, " & $cols & " columns")             _ArrayDisplay($aOk, "2d array")    

so i dont have to use too much code in the error reporting, i want it to look something like this,

Case $button10                         If Not _EzMySql_GetTable2d("SELECT * FROM " & GUICtrlRead($Input2) & " WHERE RowID = " & "'" & GUICtrlRead($Input12) & "';") Then                 MsgBox(0, "Error inserting data to Table", "Error: "& @error & @CR & "Error string: " & _EzMySql_ErrMsg())                             EndIf

but this keeps getting me errors


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>