From 81356e1d56086c547edb51c4cea73e3c0d4f3dd0 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Tue, 17 Dec 2024 12:32:19 -0500 Subject: [PATCH] last_row_id --- services/web/project/__init__.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/services/web/project/__init__.py b/services/web/project/__init__.py index 730b00d..0db3a0f 100644 --- a/services/web/project/__init__.py +++ b/services/web/project/__init__.py @@ -227,13 +227,22 @@ def start_register(): lastname= data.get('lastname') email= data.get('email') +# mycursor = mydb.cursor() +# +# sql = "INSERT INTO customers (name, address) VALUES (%s, %s)" +# val = ("John", "Highway 21") +# mycursor.execute(sql, val) +# +# mydb.commit() INSERT_MEMBERS = "INSERT INTO members_pending(email,firstname,lastname) VALUES('"+firstname+"','"+lastname+"','"+email+"')" with connection: with connection.cursor(cursor_factory=psycopg2.extras.DictCursor) as cursor: cursor.execute(INSERT_MEMBERS) - return jsonify(hello="ameye signup path world") + last_row_id=cursor.cursor + + return jsonify(hello="ameye signup path world", last_row_id=last_row_id) except Exception as e: return {