SMS from/to MySQL
You can combine Ozeki SMS Gateway with a MySQL database to send, receive and store SMS messages. In this tutorial you can see how to install and configure the connection with the proper connection string and how to create the recommended database structure.
The solution uses Ozeki SMS Gateway installed on your PC. The Database User of SMS Gateway can easily communicate with your MySQL database user through an ODBC driver which is an essential part to send or receive SMS messages with a MySQL Database. Please download it from mysql.com and learn how to install it. An ODBC v5.3 or higher is recommended, so you can have unicode character support. For example Chinese or Arabic.
When configuring the Database User, you can use the following connection string:
The connection string only works if it matches your database details. You should start by changing the IP address from 127.0.0.1 to the actual IP address of your MySQL server. Then replace the database name and also the username/password pair. Choose a user who has granted access to the database.
Please select a connection type and enter the connection string onto the Database User's configuration form
Figure 1 - Specifying the connection string for the MySQL database
After the connection string is set, it is very important to create the database table structure. The example database in this tutorial consists of two tables 'ozekimessageout' and 'ozekimessagein'. You can choose any table name, although you should keep them in mind. You are recommended to use the following table layout:
MySQL create table script:
Please maintain the 'id' field in your database to support faster SQL updates.
If you modify database tables. For example if you add additional columns, please review the SQL templates used by Ozeki SMS Gateway. Please make sure that they are compatible with the customized database table layout.