Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import mysql.connector
- cnx = mysql.connector.connect(user='ctn17_afrotopia', password='WpTA8hB0w7rKse6P',
- host='127.0.0.1',
- database='ctn17_afrotopia')
- cursor = cnx.cursor()
- query = ("SELECT titre, texte, url FROM indexation")
- cursor.execute(query)
- for (titre, texte, url) in cursor:
- print "Titre : ", titre
- print "Texte : ", texte[:30]
- print "Url : ", url
- cursor.close()
- cnx.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement