Interface Python With MySQL - 1
Interface Python With MySQL - 1
MYSQL
Or
import mysql.connector as ms
TO CREATE CURSOR
Cursor_name = connectionObject.cursor()
For e.g.
mycursor = mycon.cursor()
TO EXECUTE QUERY
We use execute () function to send query to connection
Cursor_name.execute(query)
For e.g.
mycursor.execute(„select * from emp‟ )
Example - Cursor
Output shows cursor is created and query is fired and stored, but no data is
coming. To fetch data we have to use functions like fetchall(), fetchone(),
fetchmany() are used
Fetching(extracting) data from ResultSet