Skip to content

Instantly share code, notes, and snippets.

Created January 2, 2014 12:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/8218272 to your computer and use it in GitHub Desktop.
Save anonymous/8218272 to your computer and use it in GitHub Desktop.
$myServer = "trolololol";
$myUser = "yeah";
$myPass = "MMMMM hmm";
$myDB = "WOOT!";
$date = array();
$storage = array();
// Connect to the MySQL Database
$mydbhandle = mysqli_connect($myServer, $myUser, $myPass, $myDB) or die("Couldn't connect to MySQL Server on $myServer");
//Pull the data for the graph from MySQL
$query = 'SELECT DATE, SUM( Commited ) FROM StorageUsedByVm GROUP BY DATE';
$results = mysqli_query($mydbhandle,$query);
while($row = mysqli_fetch_array($results))
{
$date = $row["DATE"];
$storage = $row["SUM( Commited )"];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment