Raspberry Pi_Kor_24.2.1 관계형 database와 SQL

24.2.1 관계형 database와 SQL

24.2.1.1 관계형 database

database는 많은 복잡한 자료를 체계적으로 저장하여 관리하고, 나중에 다양한 형식으로 자료를 쉽게 조회할 수 있는 기능을 제공해 주는 도구이다.

database 종류에는 여러 가지가 있지만, 세계적으로 많이 사용되는 대부분의 database 형태는 관계형 database이다. 관계형 database(relational database)라는 것은 그 내부의 많은 자료들이 단순히 독립적인 자료로서 따로 관리되는 것이 아니라, 여러 자료가 서로 관계를 가지면서 체계적으로 관리된다는 것이다. 이들 자료간의 관계는 사전에 내부에서 자료의 형태를 정의할 때 같이 정의되며, 그렇게 정의된 관계에 따라서 자료가 관리되면서 다양한 기능을 제공해 준다.

Raspberry Pi_Eng_24.4.9 Including PHP Script File

24.4.9 Including PHP Script File

PHP provides a way to insert ans use the text/code/markup in a specific file into the current working document. This function is very useful when you need to repeatedly use the same PHP, HTML, or text on multiple pages in PHP.

In PHP, “include” or “require” statement allows a web server to insert the contents of a particular PHP file into the PHP file of current document before executing a particular document.

Raspberry Pi_Eng_24.4.8 Function

24.4.8 Function

24.4.8.1 Definition of Function

Function is a unit of statements that can be executed repeatedly within a program. Users can freely define and use a function with arbitrary contents under certain constraints. It is defined in the following format.

function functionName( argument1, argument2, argument3…) {
code to be executed;

[ return; ]

code to be executed;
}

Raspberry Pi_Eng_24.4.7 Stop and Return of Processing

24.4.7 Stop and Return of Processing

24.4.7.1 “exit” Statement and “die” Statement

“exit” statement is a command that prints the specified message and terminates the execution of the PHP script. “die” statement is the same command as “exit” statement.

exit ( [ status-message ] )

exit ( [ status-number ] )

Raspberry Pi_Eng_24.4.5 Output

24.4.5 Output

You can use “echo” and “print” commands to print processing results in PHP. Both perform almost the same function. The text to be processed may include an HTML tag.

24.4.5.1 “echo” Command

“echo” command has no return value and can process several parameters simultaneously.

Raspberry Pi_Eng_24.4.4 Operation

24.4.4 Operation

There are a number of operations supported by PHP as follows:

■ Arithmetic operation

■ Assignment operation

■ Comparison operation

■ Incremental/ Decremental operation

■ Logical operation

■ String operation

■ Array operation

Raspberry Pi_Eng_24.4.3 Summary of PHP Syntax

24.4.3 Summary of PHP Syntax

If there is a static HTML tag on a web page, that page will always show the same content. However, if you use PHP to change the content of these HTML pages, the page will show the new changed contents. Like this, PHP plays a role to change the contents of a static HTML page into dynamic page. Therefore, according to the situation requested within the static HTML, a new HMTL is created and integrated with the existing static HTML tag to become an HTML document constituting a complete page.

Raspberry Pi_Eng_24.4.2 Installing PHP and Connection Tool to MySQL

24.4.2 Installing PHP and Connection Tool to MySQL

When installing PHP on Raspberry Pi, use the following command:

sudo apt-get install php5

If PHP is installed, the configurations of existing Apache are automatically adjusted so that PHP can integrate with Apache.