Reputation: 65
I have this script ( below ) that will not insert text into my database no matter what I do. I can print it and then copy & paste into mysql and it works fine. Other scripts execute and store just fine. Any ideas?
@client.command(pass_context=True)
async def addrule(ctx,*,rule):
g=str(ctx.guild).replace(' ','_')
sqluse(g)
x="INSERT INTO rules (rule) VALUES (\"%s\")"
val=(rule)
mycursor.execute(x % val)
Upvotes: 0
Views: 41
Reputation: 1829
Always remember to save changes to your database via
mydb.commit()
after doing permanent changes.
Upvotes: 1