MYSQL error: Unknown column 'guid' in 'NEW' mysql

vj78 21 Reputation points
2021-04-11T03:20:26.023+00:00

I have this sql statement and it gives me error: Unknown column 'guid' in 'NEW' mysql

SQL Statement in python: INSERT INTO user (username, userpassword , admin) VALUES (%s, %s, %s )

Table structure is:
userid
username
userpassword
userguid
admin

userid is auto increment
userguid is uuid() function

Azure Database for MySQL
{count} votes

Answer accepted by question author
  1. Anurag Sharma 17,636 Reputation points
    2021-04-14T06:25:16.697+00:00

    Hi @vj78 , thanks for your patience.

    Can you please try below code once? Here I passing 'myparams' in the same execute statement instead of new line:

    myresult = cursor.execute("INSERT INTO users (username, userpassword, userguid ) VALUES (%s, %s,  uuid())",myparams)  
    return (myresult)  
    

    Please let me know if it works.

    ----------

    If answer helps, please mark it 'Accept Answer'


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.