PHP study trainer (5)

Source: Internet
Author: User
: This article mainly introduces PHP practitioners (5). If you are interested in the PHP Tutorial, refer to it. Basic exercises for MySQL databases

  1. Create a database

  2. Use Database

  3. Create a table
    • Char: constant
    • Varchar: variable

  4. Display Table

  5. View table structure

  6. Insert data
    SHA1 (): the data encryption function. it creates an encrypted character and its length is exactly 40 characters.

  7. View all elements

  8. WHERE condition statement

  9. Between... And...

  10. LIKE/NOT LIKE

    • Wildcard _: match a single character; %: match 0 or multiple characters
    • If '\' is added before the wildcard, '_' or '%' is used only as the original symbol and does not have the wildcard meaning.
    • Queries with the LIKE condition statement are generally slow. because indexes cannot be used, this format should be used only when absolutely needed.

  11. Sort order by ascending ASC descending DESC

    • If the column to be sorted is of the ENUM type, the sorting is based on the order in which the ENUM value is created.

  12. Limit

    • Limit x: returns the first X records in the query record.
    • Limit x, Y: return Y Records starting from X Records
    • The LIMIT clause does not improve the query execution speed, because mysql still has to combine each record and then truncate the list.

  13. Update, delete
    • To prevent accidental updating of too many rows, you can apply a limit clause to update
    • Truncate: truncate table is preferred for clearing a TABLE.Tablename
    • To delete all data in the TABLE and the TABLE itself: DROP TABLETablename;
    • To delete the entire DATABASE: DROP DATABASEDatabasename

  14. Concat connection function

  15. Concat_ws connection function

  16. Length function

  17. Format function

  18. Use concat and format functions

  19. Rand () functions

  20. Now (), curtime (), curdate () functions

  21. Date_format function

'). AddClass ('pre-numbering '). hide (); $ (this ). addClass ('Has-numbering '). parent (). append ($ numbering); for (I = 1; I <= lines; I ++) {$ numbering. append ($ ('
  • '). Text (I) ;}; $ numbering. fadeIn (1700) ;}) ;}; script

    The above introduces PHP learning and practice (5), including some content, and hopes to help those who are interested in PHP tutorials.

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.