Connected graph.php to database