david@intel-compute-stick:~$ mkdir /var/www/html/049
david@intel-compute-stick:~$ cd /var/www/html/049
david@intel-compute-stick:/var/www/html/049$ mysql -u root -p
Enter password:
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
david@intel-compute-stick:/var/www/html/049$ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 103
Server version: 10.5.12-MariaDB-0+deb11u1 Debian 11
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> CREATE DATABASE test049;
Query OK, 1 row affected (0.029 sec)
MariaDB [(none)]> USE test049
Database changed
MariaDB [test049]> CREATE TABLE abc (name1 VARCHAR (32), name2 VARCHAR (32));
Query OK, 0 rows affected (0.182 sec)
MariaDB [test049]> CREATE TABLE def (name3 VARCHAR (32), name4 VARCHAR (32));
Query OK, 0 rows affected (0.087 sec)
MariaDB [test049]> INSERT INTO abc VALUES ("001", "001");
Query OK, 1 row affected (0.047 sec)
MariaDB [test049]> INSERT INTO abc (name2, name1) VALUES ("002", "001");
Query OK, 1 row affected (0.033 sec)
MariaDB [test049]> INSERT INTO abc (name1, name2) VALUES ("002", "001");
Query OK, 1 row affected (0.029 sec)
MariaDB [test049]> INSERT INTO abc (name1, name2) VALUES ("002", "002");
Query OK, 1 row affected (0.032 sec)
MariaDB [test049]> INSERT INTO def (name3, name4) VALUES ("001", "001");
Query OK, 1 row affected (0.036 sec)
MariaDB [test049]> INSERT INTO def VALUES ("001", "002");
Query OK, 1 row affected (0.030 sec)
MariaDB [test049]> INSERT INTO def VALUES ("abc", "abc");
Query OK, 1 row affected (0.029 sec)
MariaDB [test049]> SELECT * FROM abc;
+-------+-------+
| name1 | name2 |
+-------+-------+
| 001 | 001 |
| 001 | 002 |
| 002 | 001 |
| 002 | 002 |
+-------+-------+
4 rows in set (0.001 sec)
MariaDB [test049]> SELECT * FROM def;
+-------+-------+
| name3 | name4 |
+-------+-------+
| 001 | 001 |
| 001 | 002 |
| abc | abc |
+-------+-------+
3 rows in set (0.001 sec)
MariaDB [test049]> SELECT * FROM abc JOIN def;
+-------+-------+-------+-------+
| name1 | name2 | name3 | name4 |
+-------+-------+-------+-------+
| 001 | 001 | 001 | 001 |
| 001 | 001 | 001 | 002 |
| 001 | 001 | abc | abc |
| 001 | 002 | 001 | 001 |
| 001 | 002 | 001 | 002 |
| 001 | 002 | abc | abc |
| 002 | 001 | 001 | 001 |
| 002 | 001 | 001 | 002 |
| 002 | 001 | abc | abc |
| 002 | 002 | 001 | 001 |
| 002 | 002 | 001 | 002 |
| 002 | 002 | abc | abc |
+-------+-------+-------+-------+
12 rows in set (0.002 sec)
MariaDB [test049]> SELECT * FROM abc INNER JOIN def ON abc.name1 = def.name3;
+-------+-------+-------+-------+
| name1 | name2 | name3 | name4 |
+-------+-------+-------+-------+
| 001 | 001 | 001 | 001 |
| 001 | 001 | 001 | 002 |
| 001 | 002 | 001 | 001 |
| 001 | 002 | 001 | 002 |
+-------+-------+-------+-------+
4 rows in set (0.032 sec)
MariaDB [test049]> SELECT * FROM abc LEFT JOIN def ON abc.name1 = def.name3;
+-------+-------+-------+-------+
| name1 | name2 | name3 | name4 |
+-------+-------+-------+-------+
| 001 | 001 | 001 | 001 |
| 001 | 002 | 001 | 001 |
| 001 | 001 | 001 | 002 |
| 001 | 002 | 001 | 002 |
| 002 | 001 | NULL | NULL |
| 002 | 002 | NULL | NULL |
+-------+-------+-------+-------+
6 rows in set (0.024 sec)
MariaDB [test049]> SELECT * FROM abc RIGHT JOIN def ON abc.name2 = def.name4;
+-------+-------+-------+-------+
| name1 | name2 | name3 | name4 |
+-------+-------+-------+-------+
| 001 | 001 | 001 | 001 |
| 001 | 002 | 001 | 002 |
| 002 | 001 | 001 | 001 |
| 002 | 002 | 001 | 002 |
| NULL | NULL | abc | abc |
+-------+-------+-------+-------+
5 rows in set (0.002 sec)
MariaDB [test049]> QUIT
Bye
david@intel-compute-stick:/var/www/html/049$ php database.php > output01.txt
PHP Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in /var/www/html/049/database.php on line 14
david@intel-compute-stick:/var/www/html/049$ php database.php > output01.txt
david@intel-compute-stick:/var/www/html/049$ http localhost 80
bash: http: Kommando nicht gefunden.
david@intel-compute-stick:/var/www/html/049$ telnet localhost 80
Trying ::1...
Connected to localhost.
Escape character is '^]'.
POST /049/form1.php HTTP/1.1
host: localhost
Content-Type: application/x-www-form-urlencoded
Content-Length: 21
text1=DIES_IST_TEXT49
HTTP/1.1 200 OK
Date: Sat, 21 May 2022 15:55:01 GMT
Server: Apache/2.4.52 (Debian)
Set-Cookie: PHPSESSID=c1ekbufpsv5p0vnlkl13t97ht4; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Set-Cookie: Cookie49=DAS_IST_COOKIE_49; expires=Sat, 21-May-2022 16:55:02 GMT; Max-Age=3600
Vary: Accept-Encoding
Content-Length: 184
Content-Type: text/html; charset=UTF-8
<form method="POST" action="./form1.php">
<input type="text" name="text1"></input>
<input type="submit"></input>
</form>
c1ekbufpsv5p0vnlkl13t97ht4<br>
<br>
<br>
DIES_IST_TEXT49<br>
Connection closed by foreign host.
david@intel-compute-stick:/var/www/html/049$ telnet localhost 80
Trying ::1...
Connected to localhost.
Escape character is '^]'.
POST /049/form1.php HTTP/1.1
host: localhost
Content-Type: application/x-www-form-urlencoded
Content-Length: 21
Cookie: Cookie49a=HALLO_COOKIE49a
text1=DIES_IST_TEXT49
HTTP/1.1 200 OK
Date: Sat, 21 May 2022 15:55:25 GMT
Server: Apache/2.4.52 (Debian)
Set-Cookie: PHPSESSID=1cjnknmqoblbbco3k7bsphtbd7; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Set-Cookie: Cookie49=DAS_IST_COOKIE_49; expires=Sat, 21-May-2022 16:55:26 GMT; Max-Age=3600
Vary: Accept-Encoding
Content-Length: 199
Content-Type: text/html; charset=UTF-8
<form method="POST" action="./form1.php">
<input type="text" name="text1"></input>
<input type="submit"></input>
</form>
1cjnknmqoblbbco3k7bsphtbd7<br>
<br>
HALLO_COOKIE49a<br>
DIES_IST_TEXT49<br>
Connection closed by foreign host.
david@intel-compute-stick:/var/www/html/049$