Learn and practice PHP (5)

WBOY
Release: 2016-07-29 09:09:43
Original
905 people have browsed it

Basic exercises for MySQL database

  1. Creating a database
    Learn and practice PHP (5)

  2. Using a database
    Learn and practice PHP (5)

  3. Creating a table
    • char: Fixed length, constant
    • varchar: Variable
      Learn and practice PHP (5)

  4. Display table
    Learn and practice PHP (5)

  5. View table structure
    Learn and practice PHP (5)

  6. Insert data
    SHA1(): Encrypt data function, create an encrypted character creation, its length is exactly 40 characters
    Learn and practice PHP (5)

  7. View all elements
    Learn and practice PHP (5)

  8. WHERE conditional statement
    Learn and practice PHP (5)

    Learn and practice PHP (5)


  9. between … and…
    Learn and practice PHP (5)

  10. LIKE / NOT LIKE

    • Wildcard _: matches a single character; %: matches If 0 or more characters
    • are added with () before the wildcard character, then _ or % are only used as original symbols and have no wildcard meaning.
    • Queries with LIKE conditional statements are generally slower because they cannot take advantage of indexes, so this format should only be used when absolutely necessary

    Learn and practice PHP (5)

    Learn and practice PHP (5)

    Learn and practice PHP (5)


  11. Sort order by ascending ASC Descending DESC

    • The column to be sorted is of type ENUM, and the sorting will be based on the order in which the ENUM values ​​were created in the column.
      Learn and practice PHP (5)

    Learn and practice PHP (5)


  12. limit

    • LIMIT Will improve query execution speed, because mysql still has to gather each record together and then truncate the list

    • Learn and practice PHP (5)

  13. update, delete
    • To prevent yourself from accidentally updating too many rows, you can apply a limit clause to update
    • To clear a table, the preferred truncate: TRUNCATE TABLE tablename
    • To delete all data in the table and Table itself: DROP TABLE tablename;
    • To delete the entire database: DROP DATABASE databasename
      Learn and practice PHP (5)

  14. concat connection function
    Learn and practice PHP (5)

  15. concat_ws connection function
    Learn and practice PHP (5)

  16. length function
    Learn and practice PHP (5)

  17. format function
    Learn and practice PHP (5)

  18. concat is used with format function
    Learn and practice PHP (5)

  19. rand() function
    Learn and practice PHP (5)

  20. now(), curtime(), curdate( ) function
    Learn and practice PHP (5)

  21. date_format function
    Learn and practice PHP (5)
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above introduces PHP learning and practicing (5), including the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!