Jump to content

MYSQL: update query


Go to solution Solved by koenp,

Recommended Posts

Hello everybody,
I wondering if somebody could check/help me with this code.
I am trying to do an update query with mysql.

When I use this code nothing is happening and no error

If $OPT_TestResults = 1 then

            If Not _EzMySql_Startup() Then
                MsgBox(0, "Error Starting MySql", "Error: "& @error & @CR & "Error string: " & _EzMySql_ErrMsg())
                    Exit
            EndIf

; READ connection values from ini file
                    Global $config_file  = @ScriptDir & "\etc\config.ini"
                    Global $extractfile = IniRead($config_file, "NEMO", "extractfile","")
                    Global $User = IniRead($config_file, "NEMO", "Username","")
                    Global $Pass = IniRead($config_file, "NEMO", "Password","")
                    Global $Database = IniRead($config_file, "NEMO", "Database","")
                    Global $MySQLServerName = IniRead($config_file, "NEMO", "mysqlservername","")
                        _EzMySql_Open($MySQLServerName, $User, $Pass, $Database)

                        $aOK = "update richiest set flgpreana='I' where flgstatu IN ('I','L');"
                        ;_EzMySql_Exec($aOK)
                        $number = _EzMySql_FetchNames()
                        MsgBox(64, "Update information: ", "Total number of records that where send:       " &  $number, 10)


        EndIf

Many thanks for all your help..

Kindly regards

Koen

Link to comment
Share on other sites

  • Solution

Ok found a way arround...

Global $config_file  = @ScriptDir & "\etc\config.ini"
                    Global $extractfile = IniRead($config_file, "NEMO", "extractfile","")
                    Global $sUserName = IniRead($config_file, "NEMO", "Username","")
                    Global $sPassword = IniRead($config_file, "NEMO", "Password","")
                    Global $sDatabase = IniRead($config_file, "NEMO", "Database","")
                    Global $sServerName = IniRead($config_file, "NEMO", "mysqlservername","")
                    Local $SQLCode, $TableContents = ""

                        $SQLInstance = _MySQLConnect($sUserName,$sPassword,$sDatabase,$sServerName)
                        $SQLCode = "update richiest set flgpreana='I' where flgstatu IN ('I','L');"

                            $TableContents = _Query ($SQLInstance, $SQLCode)
                    _MySQLEnd($SQLInstance)
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...