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_Kor_24.1.2 LAMP

24.1.2 LAMP

Linux 시스템에서 해당 운영체제와 함께 database와 web server을 활용하여 web site를 구축할 수 있는 강력한 도구의 조합이 있는데, 바로 LAMP이다. LAMP는 Linux, Apache, MySQL, PHP의 조합을 의미하며, 기본 구성과 역할은 다음과 같다.

■ OS — Linux

■ Web server — Apache

■ Database — MySQL

■ script Language — PHP

Raspberry Pi_Kor_24.1.1 Database와 Web의 필요성

24.1 LAMP 개요

24.1.1 Database와 Web의 필요성

지금까지 우리는 Raspberry Pi 시스템에서 단순히 Terminal 화면에서 명령을 실행하여 그 결과를 확인하거나, 특정 application 프로그램을 실행해서 그 프로그램이 제공하는 기능을 이용하여 제한적인 작업을 하는 것이 전부였다. 하지만 이 정도의 기능만으로는 우리가 필요로 하는 모든 요구사항을 충족시켜줄 수 없으며, 여러 가지 추가적인 기능이 필요하다

Raspberry Pi_Kor_24.0 Chapter 24 Database와 Web 활용

Chapter 24 Database와 Web 활용

Chapter 주요 내용

여기서는 많은 자료를 체계적으로 저장하고 분석하여 활용하는데 사용되는 database에 대해서 상세히 설명하고 있으며, HTML, script language, web 서버를 활용하여 인터넷으로 다른 사람들과 다양한 동적인 방법으로 서로 소통할 수 있는 방법에 대해서 논의할 것이다.

다음과 같은 항목에 대한 내용을 포함하고 있다.
■ LAMP 개요

■ MySQL Database

■ Apache web server

■ PHP web script language

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