Skip to content

Examples MySQL

Rainer Stötter edited this page Apr 14, 2017 · 9 revisions

check the prerequisites

Before you can use the examples you have to have installed the fitting PHP libraries ( Install-pdo_mysql )

The script file mk-sql-data-01.cmd

This script file runs against a MYSQL database and creates relational test data.

Use the program "mysql" in order to execute the SQL commands.

Run the example script and create the test data

./mk-sql-data.php --config examples/mk-sql-data-01.cmd

Import the test data into our database

mysql -u db2phpsite -pdb2phpsite < output/random-data-mysql.sql

The script file mk-sql-data-02-mysql.cmd

This script file runs against a MYSQL database and creates relational test data.

Use the program "mysql" in order to execute the SQL commands.

Run the example script and create the test data

./mk-sql-data.php --config examples/mk-sql-data-02-mysql.cmd

Import the test data into our database

mysql -u db2phpsite -pdb2phpsite db2phpsite< output/random-fk-mysql.sql

The script file mk-sql-data-02-pdo-mysql.cmd

This script file runs against an MySQL database with the PDO interface and creates relational test data.

Use the program "mysql" in order to execute the SQL commands.

Run the example script and create the test data

./mk-sql-data.php --config examples/mk-sql-data-02-pdo-mysql.cmd

Import the test data into our database

mysql -u db2phpsite -pdb2phpsite db2phpsite < output/random-fk-mysql-pdo.sql

Clone this wiki locally