I have a (maybe very simple) question, but I do not find the solution myself...
The database includes links. These include numbers. Now I want to insert in a separate column "nummer" the number that is included in each of the links.
Below works for one number.
Now I want to use a for-loop over several numbers and extract the number from all the links and write it into the "Nummer" field.
How to modify using %i or %d?
Thanks in advance for your help!
import MySQLdb
connection = MySQLdb.connect(
host="192.168.0.101",
db='xxxxxxx',
user="xxxxxxx", passwd="xxxxxxx"
)
connection.apilevel = "2.0"
connection.threadsafety = 2
connection.paramstyle = "format"
cursor=connection.cursor()
sql="UPDATE analysen SET Nummer = 247687 WHERE `Link` like '%247687%'"
cursor.execute(sql)
connection.commit()