Interacting with MySQL using PHP with OpenShift

This article demonstrated how to interact with an OpenShift MySQL database. We’re assuming your MySQL database is populated. In this example the database name is “mydb”.   <?php $mysqli = new mysqli( $_ENV['OPENSHIFT_MYSQL_DB_HOST'], $_ENV['OPENSHIFT_MYSQL_DB_USERNAME'], $_ENV['OPENSHIFT_MYSQL_DB_PASSWORD'], $_ENV['OPENSHIFT_APP_NAME'], $_ENV['OPENSHIFT_MYSQL_DB_PORT'], $_ENV['OPENSHIFT_MYSQL_DB_SOCKET'] ); if … Continue reading