Skip to content

Instantly share code, notes, and snippets.

@samm-git
Created November 10, 2015 09:39
Show Gist options
  • Save samm-git/98591bd52bd7c568a692 to your computer and use it in GitHub Desktop.
Save samm-git/98591bd52bd7c568a692 to your computer and use it in GitHub Desktop.
<?php
for(;;){
usleep(20000); // 20 ms
$db = new PDO('mysql:host=slave;dbname=Magento;charset=utf8', 'dev_user1', 'XXXXXX', array(PDO::ATTR_EMULATE_PREPARES => false,
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
try {
//connect as appropriate as above
$db->query('SET NAMES utf8');
} catch(PDOException $ex) {
echo "An Error occured:";
echo $ex->getMessage()."\n\n";
}
$db = null; // close conn
// echo ".";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment