Skip to content

Instantly share code, notes, and snippets.

View hungdh0x5e's full-sized avatar
:octocat:
Not Found

Huy Hùng hungdh0x5e

:octocat:
Not Found
View GitHub Profile
@hungdh0x5e
hungdh0x5e / db_functions.php
Created January 14, 2016 17:18
GCM with Android Tutorial
<?php
class DB_Functions {
private $db;
//put your code here
// constructor
function __construct() {
include_once './db_connect.php';
@hungdh0x5e
hungdh0x5e / db_connect.php
Last active March 16, 2016 09:41
GCM with Android Tutorial
<?php
public function connect() {
require_once 'config.php';
$con = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
// selecting database
mysql_select_db(DB_DATABASE);
// return database handler
return $con;
}
// Closing database connection
<?php
// Database config variables
define("DB_HOST", "localhost");
define("DB_USER", "root");
define("DB_PASSWORD", "123456");
define("DB_DATABASE", "gcm");
// Google API Key
define("GOOGLE_API_KEY", "AIzaSyA7***************ViqJE");
?>