Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

mysql insert into python many

sql = "INSERT INTO Student (Name, Roll_no) VALUES (%s, %s)"
val = [("Akash", "98"),
       ("Neel", "23"),
       ("Rohan", "43"),
       ("Amit", "87"),
       ("Anil", "45"), 
       ("Megha", "55"), 
       ("Sita", "95")]
  
mycursor.executemany(sql, val)
mydb.commit()
  
print(mycursor.rowcount, "details inserted")
  
# disconnecting from server
mydb.close()
Comment

PREVIOUS NEXT
Code Example
Python :: Django is MVT Not MVC 
Python :: Overwrite text in python 
Python :: How to Remove Items in a Set in Python Using the remove() Method 
Python :: handling image files django aws 
Python :: split dataset folders in train test valid using python 
Python :: normalize a distribution plot 
Python :: axios post to django rest return fobidden 403 
Python :: postgtres settings.py setup with django 
Python :: PySimpleGUI and tkinter with camera on Android 
Python :: python this module 
Python :: python equivalent linkedhashmap 
Python :: choose what items on python 
Python :: Location of INSTALLED_APP and MIDDLEWARE 
Python :: Class based Django rest framework 
Python :: Common elements in a list(comparing two lists.) 
Python :: Python | Program to print duplicates from a list of integers 
Python :: Get First From Table Django 
Python :: aws ses service python example 
Python :: azureservicebus legacy-install-failure 
Python :: how to append the items in list 
Python :: python return multiple value from a function using a dictionary 
Python :: cgi in python; get() method 
Python :: redirect user based on input with python cgi code 
Python :: difference between = and is not python 
Python :: python + credit-german.csv + class 
Python :: python - columns that contain the lengh of a string 
Python :: install sort 
Python :: python xlrd date 
Python :: varianza en pandas 
Python :: how to vreate a list in python 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =