-
-
Save Drarok/8230064 to your computer and use it in GitHub Desktop.
Converted example to use PDO.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$dsn = 'mysql:host=trolololol;dbname=WOOT!'; | |
$username = 'yeah'; | |
$password = 'MMMMM hmm'; | |
$pdo = new PDO($dsn, $username, $password); | |
$sql = 'SELECT `date`, SUM(`Commited`) AS committedSum FROM StorageUsedByVm GROUP BY `date`'; | |
$stmt = $pdo->query($sql); | |
$data = $stmt->fetchAll(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment