Tagged Questions

1
vote
3answers
65 views

How can I insert a MySQL row IF one matched does not exist already

My table bank has three columns: uid, nick, and balance. I can insert new row perfectly fine, however it would be easy for duplicates of the nick to appear since the uid auto increments, making each ...
0
votes
1answer
62 views

Python | MySQLdb -> I cant insert

I have an odd problem. There are two databases. One has all products in it for an online shop. The other one has the online-shop software on it and only the active products. I want to take the values ...
0
votes
1answer
97 views

Python / MySQL (MySQLdb) - testing the 'insert' function - its not adding rows. Why?

I'm trying to figure out how to use the MySQLdb library in python (I am novice at best for both of them). I'm following the code here: http://www.kitebird.com/articles/pydbapi.html Specifically: ...
1
vote
3answers
86 views

MySQLdb inserting a dict into a table

I have a row of data in dict format. Is there an easy way to insert it into a mysql table. I know that I can write a custom function to convert dict into a custom sql query, but I am looking for a ...
-1
votes
1answer
45 views

MySQLdb - Error with simple statement

db = MySQLdb.connect("XXXXXXXX","root", "XXXXXX", database) cursor = db.cursor() cursor.execute('INSERT INTO media_files (ID, DATA) VALUES ("test", "test")') cursor.execute("commit") This statement ...