I tried many times to solve my problem with other questions in stackoverflow with no success. I'm learning python right now.
I know how to do it in PHP but I need to do it in python.
I have a table dentistas
with 4 columns id, web, email, telefono.
And I import from another file with a list containing web urls.
I want to insert those websurls in the web column.
The code that im using right now doesn't shows me an error in the terminal, but doesn't insert anything to the table:
# coding=utf-8
import MySQLdb
from parser import lista
bd = MySQLdb.connect('localhost', 'testuser', 'test123', 'leads') # Connecting to the database
cursor = bd.cursor() # Creating the cursor
for x in lista:
cursor.execute("INSERT INTO dentistas(web) VALUES(%s)", (x,))