# -*- coding: utf-8 -*-
"""
Created on Mon Oct 25 17:29:36 2021

@author: User
"""
import mysql.connector
from datetime import datetime



mydb = mysql.connector.connect(
  host="10.20.40.3",
  user="pressdev",
  password="PressDev987!",
  database="pressdev"
)

mycursor = mydb.cursor()


sql = "INSERT INTO todo2 (content, completed, date_created) VALUES (%s, %s, %s)"
val = ("Hello2", 0, datetime.now() )
mycursor.execute(sql, val)
mydb.commit()


mycursor.execute("SELECT * FROM todo2")
myresult = mycursor.fetchall()

for x in myresult:
  print(x)