I want to insert dictionary data into mysql each key in its own field. I tried following code. But its wrong. Can any one help? I really appreciate. thanks so much :-)
d = {"spam": "1", etc,etc,"egg": "2"}
cols = d.keys()
vals = d.values()
stmt = "INSERT INTO table (%s) VALUES(%s)" % (
",".join(cols), ",".join(len(vals))