Python Forum
Python keeps inserting NULL values into table
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python keeps inserting NULL values into table
#10
db.execute("INSERT INTO users (username, password) VALUES (:username, :password)", {"username":username, "password":password})

What should this be then? I can't figure it out with the documentation u sent. Before it used to give me a syntax error before i corrected it now I'm not getting an error but the values are NULL still.


Tried this:

db.execute("INSERT INTO users (username, password) VALUES (%s, %s)", ("username", "password",))

Now I get an error when I click the register button:

AttributeError: 'tuple' object has no attribute 'keys'
Reply


Messages In This Thread
SQL not INSERTING into table - by card51shor - Jun-09-2020, 01:31 AM
RE: Python keeps inserting NULL values into table - by card51shor - Jun-09-2020, 05:45 AM
RE: SQL not INSERTING into table - by Larz60+ - Jun-09-2020, 02:08 AM
RE: SQL not INSERTING into table - by card51shor - Jun-09-2020, 02:27 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem with number of rows containing null values PythonSpeaker 3 2,304 Nov-23-2019, 06:53 PM
Last Post: ibreeden
  Issues with Inserting Values into an Empty List with a While Loop TommyMer 2 3,850 Sep-12-2018, 12:43 AM
Last Post: TommyMer
  file a table of values Ybivashka322 4 3,845 Dec-14-2017, 06:11 PM
Last Post: mpd

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020