Guest User

Untitled

a guest
Oct 31st, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. def hello():
  2.  
  3. mariadb_connection = mariadb.connect(user='root', password='pwd',
  4. database='customers')
  5. cursor = mariadb_connection.cursor()
  6.  
  7. cursor.execute("SELECT * from customer_info")
  8. data = cursor.fetchall()
  9. cursor.close()
  10.  
  11.  
  12. namesdb = json.dumps(data)
  13.  
  14.  
  15. return render_template('select_customer.html', namesdb=namesdb)
  16.  
  17. <table id="example" class="table text-dark table-striped table-bordered
  18. display" style="width:100%">
  19.  
  20. <thead class="text-white">
  21.  
  22. <tr>
  23.  
  24. <th>Customer</th>
  25.  
  26. <th>Address</th>
  27.  
  28. <th>Price per Litre</th>
  29.  
  30.  
  31. </tr>
  32.  
  33. </thead>
  34.  
  35. <tbody>
  36.  
  37. <tr>
  38.  
  39. <td>{{namesdb}}</td>
  40.  
  41. <td></td>
  42.  
  43. <td></td>
  44.  
  45.  
  46.  
  47. </tr>
  48.  
  49.  
  50.  
  51.  
  52. </tbody>
  53.  
  54. <tfoot>
  55.  
  56. <tr>
  57.  
  58.  
  59.  
  60. </tr>
  61.  
  62. </tfoot>
  63.  
  64. </table>
  65.  
  66. </div>
  67. </div>
  68. </div>
  69.  
  70. </div>
  71. </div>
Add Comment
Please, Sign In to add comment