-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f74a700
commit 166e952
Showing
8 changed files
with
211 additions
and
55 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import mysql.connector | ||
|
||
def DataUpdate(Nombre): | ||
mydb = mysql.connector.connect( | ||
host="localhost", | ||
user="root", | ||
passwd="root", | ||
database="rasa_database" | ||
) | ||
|
||
mycursor = mydb.cursor() | ||
|
||
hola = mycursor.execute("SELECT * FROM pacientes WHERE nombre='%s' % (Nombre)") | ||
myresult = mycursor.fetchall() | ||
if (hola): | ||
print("este nombre ya estaba") | ||
else: | ||
sql = 'INSERT INTO pacientes(nombre) VALUES ("{0}");'.format(Nombre) | ||
mycursor.execute(sql) | ||
|
||
#sql = 'INSERT IGNORE INTO pacientes(nombre) VALUES ("{0}");'.format(Nombre) | ||
#mycursor.execute(sql) | ||
|
||
|
||
|
||
mydb.commit() | ||
|
||
print(mycursor.rowcount, "record inserted.") | ||
|
||
def DataValoracion(Puntos1,Puntos2,Puntos3,Cambios): | ||
mydb = mysql.connector.connect( | ||
host="localhost", | ||
user="root", | ||
passwd="root", | ||
database="rasa_database" | ||
) | ||
|
||
mycursor = mydb.cursor() | ||
|
||
sql = 'INSERT INTO valoracion(fecha,pregunta1,pregunta2,pregunta3,cambios) VALUES (now(),"{0}","{1}","{2}","{3}");'.format(Puntos1,Puntos2,Puntos3,Cambios) | ||
mycursor.execute(sql) | ||
|
||
mydb.commit() | ||
|
||
print(mycursor.rowcount, "record inserted.") | ||
|
||
if __name__=="__main__": | ||
DataUpdate("Maria") | ||
DataValoracion("6","8","7","Mejorar Respuestas") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters