Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from flask import Flask, render_template
- import MySQLdb
- app = Flask(__name__)
- mariadb_connection = MySQLdb.connect(user='root', password='24611943e', database='bookstore')
- cursor = mariadb_connection.cursor()
- @app.route('/', methods=['POST', 'GET'])
- def main():
- cursor.execute("SELECT title, isbn FROM books")
- calendar = cursor.fetchall()
- return render_template('index.html', calendar=calendar)
Add Comment
Please, Sign In to add comment