Skip to content

Commit

Permalink
connectivity program using mysqldb
Browse files Browse the repository at this point in the history
  • Loading branch information
rakeshlinux committed Mar 31, 2020
1 parent 4862d6b commit 5addfcb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
File renamed without changes.
5 changes: 5 additions & 0 deletions database/check_module.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import MySQLdb
db = MySQLdb.connect('localhost','root','','davschool')
cursor = db.cursor()
cursor.execute('insert into game values (12,"cricket")')
db.close()
5 changes: 5 additions & 0 deletions database/delete_row.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import MySQLdb
db=MySQLdb.connect('localhost', 'root', '', 'davschool')
cursor=db.cursor()
cursor.execute('delete from game where gname="cricket" ')
db.close()
2 changes: 1 addition & 1 deletion database/mysql_connection.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Database connectivity mysql."""
import MySQLdb
# Open database connection
db = MySQLdb.connect("localhost", "root", "", "cable" )
db = MySQLdb.connect("localhost", "root", "", "binarynote" )
# prepare a cursor object using cursor() method
cursor = db.cursor()
# execute SQL query using execute() method.
Expand Down

0 comments on commit 5addfcb

Please sign in to comment.