FTP、PHP、SQL Intro

6381 ワード

2020年9月15日

インテリジェント/ハイブリッドアプリケーションの開発
復習入門no.2

FTP:

FTP - The File Transfer Protocol is a standard network protocol used for the transfer of computer files between a client and server on a computer network.

The difference between HTTP and FTP:
HTTP (Hypertext TP)
FTP (File TP)
used to access different websites on the internet
used to transfer files from one host to the another
establishes data connection only
establishes data as well as control connection
some facts about FTP:
  • 一般人はあまり使いません.不便だからエンジニアのみ.This is typically used by companies when they share files that they need to protect with utmost privacy to another company; for ex, the sender-company gives the receiver-company an ID & Password that the receiver-company needs to plug in in order to access the sender-company's files.

  • WindowsのFTPクライアントプログラムです.最もよく使われるのは卵駆動です(注記、ドライブはFTP.IE/ChromeがWebサーバのクライアントです.)

    PHP:

    PHPを使用してコードを記述する場合、ファイル名は~~.htmlじゃないphpのはずです.
    PHPはCompilerプログラムではありません.通常のCompiler面:
    How compile programs work: the source code gets compiled into binary code for machines to understand. Typically program companies would give out the compiled binary code to their consumers who bought their program.
    PHP is an interpreted language. An interpreted language is a type of programming language for which most of its implementations execute instructions directly and freely, without previously compiling a program into machine-language instructions.

    The Client server, which is not the actual computer but browsers like IE/Chrome, uses HTTP protocol to request to the Web Server (Apache, in this case). Therequestex:on browserアドレス、192.168.19.11/~st 01でenterにヒットします.Thenは、ユーザがPHPモジュール(「解析器」-解析を実行する前のステップ)をApacheに追加すると、Apacheは(私たちの先生が言った「鳥」)の内容がHTMLソースコードではなくPHPコードであることを実行し、知ることになる.So then Apache will just RUN the php bit, instead of processing it like how it would with HTML.

    PHP is a 100% server-side language. Side fact: game companies are trying to make everything 100% server-side so that the consumers' individual computers won't need a good video card for the games, since the server will run all of their individual games and just make it show up basically on their computer.

    Since PHPは仕事(オフィス)に使用され、キーボード入力を認識できません.だからゲームに触ってはいけない

    PHP doesn't even use real memory. It doesn't even have the concept of pointers. 変数のタイプも自分で変わります.
    ≪変数|Variable|oem_src≫:値を格納するメモリ「≪コンテナ|Container|oem_src≫」.phpを除いて、ほとんどのプログラミング言語のIt's aメモリ番号.In the olden days, we used to type 16-digit memory addresses instead of the variables. lol.
    $a = 1; --> ここで、$is a演算子aka演算子.
    *最近の傾向は、長い変数名を使用することです.変数名条件:1)大文字と小文字を区別します.2) don't start with a number. 3) always must be in English. Never korean. 4)特殊文字(特殊文字)は使用しないでください.

    スラッシュ()-->escapeコードと呼ばれます.脱出パスワード

    会社に勤めています.
    変数名-->必ず原則に従って作成してください.

    PHPは$a=1である.と$a="AA";いいですよ.他の言語では使用できません.「1」+2なら3

    Playing around with PHP:

    $bo= TRUE;
    int=(integer)int= (integer)int=(integer)bo; --> find out what it turns out in php
    str=(string)str= (string)str=(string)bo; --> find out what it turns out to be in php

    (integer)は演算子です.

    コンピュータ言語:1は隠されています.TRUE. 一方、NULLは偽物.FALSE.

  • if you try to print the value of TRUE on a browser, it will come out as 1.

  • if you cast TRUE into an integer, it's 1.

  • if you cast TRUE into a string, it's "1".

  • if you try to print the value of FALSE on a browser, nothing will come out.

  • if you cast FALSE into an integer, it's 0.

  • if you cast FALSE into a string, it's either empty or null (not sure because you just can't see anything on the browser).

  • NULLは値がないという意味ですつまり変数はありません.
    PHPの場合、$A=""もNULLです.

    singlequotes"の中のnrtこれらの子供は食べ物を食べません.so if you can, always try to use double quotes""
    *ブラウザにはnrtという子供はいません!

    上のすべてのソースコードを実行してください.

    PHP prints out TRUE as 1. and it prints out strings without the quotations.

    PHP form:

  • properties: method, action
    method: post or get. for postは,入力した内容をパケットに転送する.大量のデータを転送でき、外部露光はgetより小さい.全然ないわけじゃないfor get, it's only used when post can't be used. lol
    action: basically where you want to send the info to. which page you want to send it to. ex: "0-3.php"

  • inside forms, there are inputs. various kinds like text, submit, reset. so it can be an input section or a button. they are all made through an input tag. an input should always have a name. so that you can retrieve the input value at the action website through $_POST[~~].

  • SQL:
  • Easy for一般人が勉強します.
  • (side note) in cmd prompt: >dir --> tells you what's inside the directory that you're in currently
    To run SQL using Oracle:
    sqlplus st01/1234@oracle (st01 is id and 1234 is password)
    While running SQL, if you want to run an sql file, you just do SQL> @[filename] and press enter.
    If you want to edit your database (which is an sql file), you just edit the data file you want and run it again.
    ***Btw, I use DB Browser to edit my sqlite files.

    Excel has a limit on how much data it can hold. So companies use RDBSM (ex: Oracle, MySQL, SQLite, etc.)
    Relational Database Management System.
    The table columns used to be called fields, but now called columns. And entries are rows.

    Queries:
     SELECT - data를 검색해서 봄. 

    (DML)
     INSERT - table에 행을 더할때
    
     UPDATE
    
     DELETE

    (DDL)
     CRERATE
    
     ALTER - table의 구조를 수정
    
     DROP

    (DCL)
     GRANT
    
     REVOKE

    SELECT [col, col, ... | *] --> * if you want all the columns of the table)
    ex: 2 FROM table; *an SQL statement only ends when there's a semi-colon.

    DESC table; --> テーブル構造を検索します.VARCHR 2(テキスト)、DATE、NUMBER、moreなど、各フィールドのタイプ(type)も取得できます.Column of type text is left-aligned. column of type number is right-aligned. (interesting lol)

    SELECT * FROM tab; --> regurgitates back to you ALL the tables you have, i.e. in your schema.

    SELECT * FROM student; --> the whole student table shows up

    Reserved words for SQL: SELECT, EXTRACT, DESC, FROM, etc.... not exactly the same as queries.