Skip to content

Instantly share code, notes, and snippets.

@ricardosiri68
Forked from anonymous/gist:7494553
Last active December 28, 2015 11:39
Show Gist options
  • Save ricardosiri68/7494601 to your computer and use it in GitHub Desktop.
Save ricardosiri68/7494601 to your computer and use it in GitHub Desktop.
import MySQLdb
import datetime
basededatos = MySQLdb.connect(host='localhost',passwd='1234',user='root', db = 'trabajo_practico' )
cursor = basededatos.cursor()
nombre = raw_input ("Ingrese nombre: ")
responsable = raw_input ("Ingrese nombre del responsable: ")
fecha_inicio= input ("Ingrese fecha (fomarto y-m-d):")
estado= raw_input("Ingrese el estado: ")
historial = raw_input("Ingrese historial: ")
insert="""
INSERT INTO
`trabajo_practico`.`Proyecto`
(
Nombre,
responsable,
estado,
fecha_inicio,
historial
)
VALUES
('%s', '%s', '%s','%s', '%s');
""" % (
nombre,
responsable,
estado,
fecha_inicio,
historial
)
cursor.execute(insert)
basededatos.commit()
basededatos.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment