Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
error when dealing with uuid
#11
Ok, as per suggestion, I used python to include the UUID() in the INSERT statement and it works.

I have another error when I use %s. The reason I said %s is when I hard code the values it works.

Error Message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '%s, %s, uuid())'

mydb = mysqldb.connect(host="xxxxx", user="xxxxx",password="xxxxxxx", db="xx", use_unicode=True,charset="utf8")
            mycursor = mydb.cursor()
            myparams = (username, password,  )
            print(myparams)

            mysql = mycursor.execute("INSERT INTO user (username, userpassword, userguid ) VALUES (%s, %s,  uuid())")
            myresult = mycursor.execute(mysql, myparams)
            mydb.commit()
            return (myresult)
Reply


Messages In This Thread
error when dealing with uuid - by vj78 - Apr-10-2021, 02:07 PM
RE: error when dealing with uuid - by ibreeden - Apr-11-2021, 09:42 AM
RE: error when dealing with uuid - by vj78 - Apr-11-2021, 10:26 AM
RE: error when dealing with uuid - by vj78 - Apr-11-2021, 10:26 AM
RE: error when dealing with uuid - by ibreeden - Apr-11-2021, 11:52 AM
RE: error when dealing with uuid - by vj78 - Apr-11-2021, 02:39 PM
RE: error when dealing with uuid - by vj78 - Apr-11-2021, 03:14 PM
RE: error when dealing with uuid - by vj78 - Apr-11-2021, 05:34 PM
RE: error when dealing with uuid - by ibreeden - Apr-11-2021, 06:14 PM
RE: error when dealing with uuid - by vj78 - Apr-11-2021, 09:23 PM
RE: error when dealing with uuid - by vj78 - Apr-12-2021, 01:10 AM
RE: error when dealing with uuid - by ibreeden - Apr-12-2021, 07:33 AM
RE: error when dealing with uuid - by vj78 - Apr-12-2021, 09:03 AM
RE: error when dealing with uuid - by ibreeden - Apr-12-2021, 10:25 AM
RE: error when dealing with uuid - by vj78 - Apr-12-2021, 02:17 PM
RE: error when dealing with uuid - by ibreeden - Apr-12-2021, 05:59 PM
RE: error when dealing with uuid - by vj78 - Apr-13-2021, 12:16 AM
RE: error when dealing with uuid - by snippsat - Apr-13-2021, 12:10 PM
RE: error when dealing with uuid - by vj78 - Apr-13-2021, 01:25 PM

Forum Jump:

User Panel Messages

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