# Common usage of pymysql

Time：2019-12-1

The difference between cursor. Fetchone() and cursor. Fetchall():

Cursor. Fetchone(): only one data can be displayed

Cursor. Fetchall(): to display all the data found

Other common methods of pymsql

import pymysql

#Connect to database

#Create a cursor object using the cursor () method
cursor = db.cursor()

#Executing SQL statements using the execute() method
cursor.execute("SELECT * FROM order_info")

#Use fetchone() to get a result data
Result = cursor. Fetchone() (only one row of results is displayed)

#Get all the result data using total()
data = cursor.fetchall()

#Close the connection between cursor and database
cursor.close()
db.close()

Update SQL
cursor.execute(sql)
db.commit()

## How to search files or directories under CentOS

Search for files or directories: The search for files is great! Because we often need to know where that file is, let’s talk about how to search it! There are also quite excellent ones under Linux Search system! Usually find is not very common! Because the speed is slow, but also very hard disk! Usually […]