Created
August 11, 2020 15:24
-
-
Save isaiah7p/33517a9e89f2f4b20bd1575f4c68916a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 yum update -y | |
2 clear | |
3 ls -lrt | |
4 clear | |
5 ifconfig | |
6 yum install httpd | |
7 yum install mysql -y | |
8 ls -lrt | |
9 mysql -h mydatabase.cz1fpo0hglyu.us-east-1.rds.amazonaws.com | |
10* | |
11 mysql -h mydatabase.cz1fpo0hglyu.us-east-1.rds.amazonaws.com -P 3306 -u admin -p | |
12 uname -n | |
13 uname -a | |
14 clear | |
15 cd /var/www/html | |
16 clear | |
17 nano info.php | |
18 cat>info.php | |
19 cat info.php | |
20 clear | |
21 service httpd start | |
22 service httpd status | |
23 clear | |
24 curl http://localhost/info.php | |
25 sudo yum -y install epel-release | |
26 sudo yum-config-manager --enable remi-php72 | |
27 sudo yum update | |
28 sudo yum install php | |
29 service httpd stop | |
30 service httpd start | |
31 curl http://localhost/info.php | |
32 pwd | |
33 ls -lrt | |
34 chmod +x info.php | |
35 sudo yum install php72 | |
36 sudo yum install php72-php-fpm php72-php-gd php72-php-json php72-php-mbstring php72-php-mysqlnd php72-php-xml php72-php-xmlrpc php72-php-opcache | |
37 php --version | |
38 chkconfig httpd on | |
39 service httpd start | |
40 service httpd status | |
41 service httpd status | |
42 history | |
43 clear | |
------------ | |
<?php | |
$servername = "RDSNAME"; | |
$username = "ADMIN"; | |
$password = “PASSWORD”; | |
$dbname = "DBNAME"; | |
// Create connection | |
$conn = new mysqli($servername, $username, $password, $dbname); | |
// Check connection | |
if ($conn->connect_error) { | |
die("Connection failed: " . $conn->connect_error); | |
} | |
$sql = "SELECT device_id, device_name, status FROM deviceinfo"; | |
$result = $conn->query($sql); | |
if ($result->num_rows > 0) { | |
// output data of each row | |
while($row = $result->fetch_assoc()) { | |
echo "id: " . $row["device_id"]. " - Name: " . $row["device_name"]. " " . $row["status"]. "<br>"; | |
} | |
} else { | |
echo "0 results"; | |
} | |
$conn->close(); | |
?> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment