current position:Home>[review JS] to consolidate the foundation day23- front end, you should also know some databases

[review JS] to consolidate the foundation day23- front end, you should also know some databases

2021-08-27 05:43:39 xn213

This is my participation 8 The fourth of the yuegengwen challenge 23 God , Check out the activity details :8 Yuegengwen challenge

*** What I learned today : ( Understand database related issues ) ! Check for defects and make up for omissions ! ***

It can be used as a learning route for beginners , Please refer to , Learning progress is not particularly in a hurry ! Ongoing update

Combine your own understanding , Simple and comprehensive summary in vernacular JavaScript Basic knowledge points in the learning process , Facilitate deeper understanding !

Let's start today's study ! ' Only by laying a solid foundation can we build a tall building '! come on. ! take sth. seriously !!

1、 database

database : A warehouse for storing data   U disc   Hard disk  

Common database languages :

  • sqlServer
  • mysql
  • oracle
  • db2

The data stored in the database are structured data .

for example :

Hello everyone , My name is XXX I graduated from Tsinghua University   Computer science   I don't have a girlfriend right now   Welcome to be good friends with you .

full name   Gender   Current address   Graduation school   major
So and so   male     Beijing   tsinghua       Computer
So and so   male     Beijing   Peking University       Communication engineering

structured :

Data in the database It exists in the form of tables

Relational database : Each database consists of multiple tables , A table consists of multiple rows and columns

The title of each column is called the field title , The corresponding content is table data

Storing data :

First step : Create database

Code implementation : create database Database name

The second step : Create table

create table  Table name 
    (
         Field name     type ,
         Field name     type ,
       ....     
    )
 Copy code 

The third step : The data in the table is analyzed increase   Delete   Change   check  

  • increase :insert into Table name ( Field 1, Field 2,...)values( value 1, value 2,...)

Be careful : The field data added by the primary key is ignored and left blank   If the type of value is character , The value must be quoted

  • Delete : delete from Table name where Conditions

    • Condition statement :

      • Is equal to   use  =
      • Show and   use and
      • Express or   use  or
      • If the condition field value is a character   Must be quoted
  • Change :

    update Table name set Field = The new value , Field = The new value where   Conditions

  • check :

    • select * from   Table name     Query all field data in the table
    • select Field name , Field name 2 from   Table name   Query the specified field

data type :

int   Represents integer data       char(100)   Indicates the character type     varchar(100)

Primary key : primary key   characteristic : Data cannot be repeated ( Have uniqueness )

Usually in a table Number The field is the primary key Generally, the primary key is self incrementing  

How to set the primary key :

create table  Table name 
(
   sid int primary key  auto_increment  sid  Field is     Primary key     And it's self increasing 
)
 Copy code 

php How to operate the database

Client submits data to server :

  • Form transfer value name
  • Hyperlink pass value <a href="xxx.php?id=213">
  • ajax Passing data to the server jsonp Request interface

php Operating database steps :

m8-day22-23-1

  1. Select data source  localhost
  2. Set up the database
  3. Determine character encoding Prevent confusion code mysql_query('set names utf8')
  4. To write sql sentence
  5. perform sql sentence mysql_query
  6. Return execution result

Notice : come on. , Dream catcher

Learning is an ongoing process , Hold the line , There must be gains !

Accumulate over a long period , Consolidate the foundation , Enter the factory early !

It's not easy to insist , It's not easy to stick to it , you are so good !

Calm Down & Carry On!


Read more :

Previous update review

【 Relearning JS】 Learn to consolidate the foundation series every day :

【day1】js initial

【day2】 Various operators 【day3】 data type 【day4】 Loop structure & Conditional statements 【day5】 function ( a key )【day6】 Scope & event

【day7】 object & Array method summary 【day8】 String method & Partial sorting

【day9】Math object & Packaging function 【day10】BOM- Browser object model

【day11】DOM- Document object model

【day12】Event The event object is first known ( One )【day13】Event The event object is first known ( Two )

【day14】 Event delegation & Drag and drop principle

【day15】 Drag implementation & Regular initial knowledge 【day16】 Regular concrete method

【day17】cookie【day18】ES6

【day19】Js Encapsulation of motion function

【day21】 Study and review in the first three weeks

【day22】 Server side and client side

More expectations on the road ... A long way to go ==-..-==

copyright notice
author[xn213],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2021/08/20210827054336282a.html

Random recommended