michaelslamet Posted December 30, 2012 Share Posted December 30, 2012 (edited) Could anybody please give an example how to update record using MySQL UDF? Looking around and seems cant find anything about this Local $SQLCode, $TableContents = "" $SQLInstance = _MySQLConnect($sUserName,$sPassword,$sDatabase,$sServerName) $SQLCode = "UPDATE mytable SET Price='430' WHERE ProductID='BEX01'" $TableContents = _Query ($SQLInstance, $SQLCode) With $TableContents While NOT .EOF .MoveNext WEnd EndWith _MySQLEnd($SQLInstance) This code seems so wrong because after While NOT .EOF it does nothing :-D Thanks in Advance Edited December 30, 2012 by michaelslamet Link to comment Share on other sites More sharing options...
michaelslamet Posted December 30, 2012 Author Share Posted December 30, 2012 Found the solution myself. I connect to the database using a privillege that read-only so i cant write/update to the database This code works: Local $SQLCode, $TableContents = "" $SQLInstance = _MySQLConnect($sUserName,$sPassword,$sDatabase,$sServerName) $SQLCode = "UPDATE mytable SET Price='430' WHERE ProductID='BEX01'" $TableContents = _Query ($SQLInstance, $SQLCode) _MySQLEnd($SQLInstance) 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