Dev Shed Forums - Python Programming http://forums.devshed.com/ Python Programming forum discussing coding techniques, tips and tricks, and Zope related information. Python was designed from the ground up to be a completely object-oriented programming language. en Mon, 16 Jul 2018 07:36:17 GMT vBulletin 60 http://forums.devshed.com/images/misc/rss.png Dev Shed Forums - Python Programming http://forums.devshed.com/ MySQL INSERT Problem http://forums.devshed.com/python-programming/980850-mysql-insert-new-post.html Thu, 12 Jul 2018 23:38:16 GMT I am trying to insert a row into a table with this code:
Code:

query="INSERT INTO Members VALUE ('"+args["first"].value+"','"+args["last"].value+"','"+mac+\
                                "','"+args["email"].value+"',false,'','');"
                        try:
                                rows=cur.execute(query)
                                print("Success - ",rows)
                        except (MySQLdb.Error,MySQLdb.Warning) as e:
                                print("Error:  [%d] - %s" % (e.args[0], e.args[1]))

I am getting the "Success" output with 1 row. However, when I manually do a "select * from Members" the empty set is returned. Obviously in spite of the row count being 1, nothing was added to the table. I have no clue how to debug this since it looks like a success from Python. Can someone explain how this is possible or how to debug it? TIA. ]]>
Python Programming gw1500se http://forums.devshed.com/python-programming-11/mysql-insert-980850.html