Book Image

LiveCode Mobile Development Cookbook

By : Dr. Edward Lavieri
Book Image

LiveCode Mobile Development Cookbook

By: Dr. Edward Lavieri

Overview of this book

Table of Contents (17 chapters)
LiveCode Mobile Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using MySQL


MySQL databases are relational data management systems that require a server to reside in. We interface with these databases with user accounts established by the database administrator. We use MySQL syntax, which is a specific query language, to read, write, and modify the database. In this recipe, you will learn how to connect to a MySQL database, how to read it, and how to modify it.

Getting ready

You will need to know the specific address of your database, the username, the password, and the port number.

How to do it...

Use the following information to integrate the MySQL database interaction into your mobile app:

  1. To connect to a MySQL database, we use the following code. Be sure to replace each _____ with your actual data:

    global dbID
    local dbAddress, dbName, dbUser, dbPassword
    
    put "_____" into dbAddress
    put "_____" into dbName
    put "_____" into dbUser
    put "_____" into dbPassword
     
    put revOpenDatabase("MySQL", dbAddress, dbName, dbUser, dbPassword) into dbID
  2. Our second major function...