Sign in to follow this  
Followers 0
michaelslamet

[ASK] Using MySQL UDF, how to make it safe?

6 posts in this topic

In my AutoIT app, I would like to allow user to edit values of a MySQL database through a GUI Interface,

but since this database is accessed (read and write) by many users at the same time and this is a very important database,

I afraid my AutoIT application damage the database when write to it without any prevention.

I mean what it's going to happen if my app write to the database while some other users open the record

and in a edit mode through their own interface/GUI ? What if my app and the user write the database on the

same time? and other scenario that I cant think at this moment?

If it dangerous, I will only display the value through my app and display a message to ask the user to

edit the value manually through their own interface/GUI.

If this important to tell: the user's gui is created using visual foxpro and access to the mysql through ODBC.

I hope somebody understand what I mean :-D

Merry Christmas and Happy New Year, everybody :)

Share this post


Link to post
Share on other sites



You tell the database what you want to do (read, edit) and then it's the job of the database to make sure that only one session changes a record at the same time (that's called a transaction).

Check the MySQL documentation how to savely code what you need.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Hi Water,

So I only need to tell the database what to do (read/edit) through MySQL UDF and the mysql server will take care the rest including the safety?

Share this post


Link to post
Share on other sites

Correct. This is what databases are for.

Before you start to work with databases (MySQL in your case) you need some basic understanding how databases work. Get a good book or internet tutorial and don't start to code before you know how it works.

Use a test database before releasing your script to production.

Just my 2 cents.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Ok, thanks a lot, Water :)

Share this post


Link to post
Share on other sites
:D

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


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
Sign in to follow this  
Followers 0