-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdatabase.php
More file actions
28 lines (24 loc) · 842 Bytes
/
database.php
File metadata and controls
28 lines (24 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
require __DIR__ . '/env.php';
$app = array();
$app['bucket_name'] = "library-258507.appspot.com";
$app['mysql_user'] = $mysql_user;
$app['mysql_password'] = $mysql_password;
$app['mysql_dbname'] = "counter";
$app['project_id'] = getenv('library-258507');
$servername = null;
$username = $app['mysql_user'];
$password = $app['mysql_password'];
$dbname = $app['mysql_dbname'];
$dbport = null;
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname,
$dbport, "/cloudsql/library-258507:us-central1:library1234");
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// echo "\nConnected successfully\n";
// echo "\ntesting gcloud php\n";
?>
<!-- $conn = mysqli_connect("35.224.164.95", "root", "navin1234","count") or die ("error".mysqli_error()); -->