Skip to content

Instantly share code, notes, and snippets.

@bkozora
Created April 13, 2016 12:31
Show Gist options
  • Save bkozora/46d7fea55afd7dfb927f48eabfd2bc4f to your computer and use it in GitHub Desktop.
Save bkozora/46d7fea55afd7dfb927f48eabfd2bc4f to your computer and use it in GitHub Desktop.
Magento -
<?php
// Bootstrap Magento
require_once("../www/app/Mage.php");
$app = Mage::app('default');
// Grab our database config info
$config = Mage::getConfig()->getResourceConnectionConfig("default_setup");
// Connect to our RDS MySQL instance
$mysqli = new mysqli($config->host, $config->username, $config->password, $config->dbname);
// check RDS MySQL connection
if ($mysqli->connect_errno) {
printf("Connect failed: %s\n", $mysqli->connect_error);
exit();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment