Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def hello():
- mariadb_connection = mariadb.connect(user='root', password='pwd',
- database='customers')
- cursor = mariadb_connection.cursor()
- cursor.execute("SELECT * from customer_info")
- data = cursor.fetchall()
- cursor.close()
- namesdb = json.dumps(data)
- return render_template('select_customer.html', namesdb=namesdb)
- <table id="example" class="table text-dark table-striped table-bordered
- display" style="width:100%">
- <thead class="text-white">
- <tr>
- <th>Customer</th>
- <th>Address</th>
- <th>Price per Litre</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>{{namesdb}}</td>
- <td></td>
- <td></td>
- </tr>
- </tbody>
- <tfoot>
- <tr>
- </tr>
- </tfoot>
- </table>
- </div>
- </div>
- </div>
- </div>
- </div>
Add Comment
Please, Sign In to add comment