forked from agubba3/GoPool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dbtest.php
34 lines (25 loc) · 808 Bytes
/
dbtest.php
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
28
29
30
31
32
33
34
<?php
// require('Connection.php');
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
$servername = "gopool.cklcxx7fvgfc.us-west-2.rds.amazonaws.com:3306";
$username = "gopool_master";
$password = "saltyswoleman18";
// Create connection
$conn = new mysqli($servername, $username, $password);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$db_selected = mysqli_select_db($conn,'gopooldb');
$result = mysqli_query($conn, "SELECT * FROM test");
if (!$result) {
$message = 'Invalid query: ' . mysqli_error($conn) . "\n";
$message .= 'Whole query: ' . $result;
die($message);
}
// //fetch tha data from the database
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
echo "Test ID: ".$row['test_id'];
}
?>