Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import mysql.connector
- dbhost = "localhost"
- dbname = "imagecrawler"
- dbuser = "imagecrawler"
- dbpass = "imagecrawlera"
- tablecount = 128
- connection = mysql.connector.connect(host=dbhost, database=dbname, user=dbuser, password=dbpass)
- for i in range(tablecount):
- query = "select GROUP_CONCAT(basic_img_id) from %s where is_id=%s" % ("IMAGES_" + str(i), "22")
- print(query)
- cursor = connection.cursor()
- cursor.execute(query)
- ids = cursor.fetchone()[0]
- if ids:
- query = "update %s set author_id=%s where basic_img_id in (%s)" % ("IMAGE_AUTHOR_" + str(i), "594532", ids)
- print(query)
- cursor = connection.cursor()
- cursor.execute(query)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement