Just apply this code and your problem will be solved
1.
import MySQLdb
2.
3.
conn = MySQLdb.connect (host = "nephews", user = "huey", passwd = "dewey", db = "louie")
4.
cursor = conn.cursor ()
5.
table_name = "kumquat"
6.
7.
nlines = cursor.execute ("DROP TABLE IF EXISTS " + table_name)
8.
for x in range(nlines):
9.
print cursor.fetchone ()
10.
cursor.close ()
11.
12.
tdesc = "CREATE TABLE " + table_name + "("
13.
tdesc = tdesc + "IDseq INT(7) UNSIGNED,"
14.
tdesc = tdesc + "Protocol VARCHAR(8), "
15.
tdesc = tdesc + "Function VARCHAR(8), "
16.
tdesc = tdesc + "Threads INT(10) UNSIGNED, "
17.
tdesc = tdesc + "Speed DECIMAL(10,3) "
18.
tdesc = tdesc + ")"
19.
cursor = conn.cursor ()
20.
nlines = cursor.execute (tdesc)
21.
for x in range(nlines):
22.
print cursor.fetchone ()
23.
cursor.close ()
Future Desings And Gadgets only at:
http://techonova.com
Latest Technology News and Updates by
http://technologytoday.in
Latest World News :
http://technologytoday.in/category/world-news/