<?php
setcookie ("Cookie22", "Hallo", time () + 3600);
?>
<?php
echo $_COOKIE ["Cookie22"];
?>
<?php
include ('/home/david/mysqldata.php');
$handle = mysql_connect ("127.0.0.1", $MYSQL_NAME, $MYSQL_PASSWORD);
mysql_query ("USE test010", $handle);
mysql_query ("INSERT INTO abc VALUES (\"010\", \"011\")", $handle);
$result = mysql_query ("SELECT * FROM abc JOIN def", $handle);
while ($row = mysql_fetch_row ($result))
echo $row [0] . " " . $row [1] . " " . $row [2] . " " . $row [3] . "<br>\n";
mysql_close ($handle);
?>
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<header></header>
<main></main>
<footer></footer>
<form action="./form.php" method="GET">
<input type="text" name="text1"></input>
<input type="submit"></input>
</form>
</body>
</html>
<?php
echo $_GET ["text1"];
?>
david@intel-compute-stick:~$ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 615
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 test010;
Query OK, 1 row affected (0.064 sec)
MariaDB [(none)]> USE test010;
Database changed
MariaDB [test010]> CREATE TABLE abc (abc01 VARCHAR (32), abc02 VARCHAR (32));
Query OK, 0 rows affected (0.262 sec)
MariaDB [test010]> CREATE TABLE def (def01 VARCHAR (32), def02 VARCHAR (32));
Query OK, 0 rows affected (0.070 sec)
MariaDB [test010]> INSERT INTO abc VALUES ("001", "002");
Query OK, 1 row affected (0.100 sec)
MariaDB [test010]> INSERT INTO abc VALUES ("003", "004");
Query OK, 1 row affected (0.032 sec)
MariaDB [test010]> INSERT INTO def VALUES ("005", "006");
Query OK, 1 row affected (0.036 sec)
MariaDB [test010]> INSERT INTO def VALUES ("007", "008");
Query OK, 1 row affected (0.032 sec)
MariaDB [test010]> SELECT * FROM abc;
+-------+-------+
| abc01 | abc02 |
+-------+-------+
| 001 | 002 |
| 003 | 004 |
+-------+-------+
2 rows in set (0.025 sec)
MariaDB [test010]> SELECT * FROM def;
+-------+-------+
| def01 | def02 |
+-------+-------+
| 005 | 006 |
| 007 | 008 |
+-------+-------+
2 rows in set (0.001 sec)
MariaDB [test010]> SELECT * FROM abc JOIN def;
+-------+-------+-------+-------+
| abc01 | abc02 | def01 | def02 |
+-------+-------+-------+-------+
| 001 | 002 | 005 | 006 |
| 003 | 004 | 005 | 006 |
| 001 | 002 | 007 | 008 |
| 003 | 004 | 007 | 008 |
+-------+-------+-------+-------+
4 rows in set (0.001 sec)
MariaDB [test010]> QUIT
Bye
david@intel-compute-stick:~$
david@intel-compute-stick:~$ php /var/www/html/010/database.php
001 002 005 006<br>
001 002 007 008<br>
003 004 005 006<br>
003 004 007 008<br>
010 011 005 006<br>
010 011 007 008<br>
david@intel-compute-stick:~$