Very newb.
Have the following
cursor = db.cursor()
cursor.execute("SELECT email,id FROM list")
userData = cursor.fetchall()
cursor.execute("INSERT INTO campaigns(date) VALUES('Now')")
the first part works, the second does not (realize it wouldn't enter actual datetime), just trying to see if it will insert into database.
Why doesn't this work? I'm hoping to avoid having many db. entries with same username/passes.
I figured it would work? userData would contain what I want, and then cursor.execute would do afterwards.
Thanks!
[edit]
I actually tried to just do an insert statement by itself, and its not working?!? Any reason this should NOT work?
import mysqldb
db = MySQLdb.connect(host="host", port=3306, user="python", passwd="test", db="python")
cursor = db.cursor()
sql = "INSERT INTO campaigns(date) VALUES ('est')"
cursor.execute(sql)
The above code the SELECT statement works fine.