From 73ef222feb2d5f2700c2c119848830702b67e737 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Fri, 17 Nov 2023 11:12:51 +1100 Subject: [PATCH] feat: Add get all links function --- db.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/db.py b/db.py index c9f2c11..97966f0 100644 --- a/db.py +++ b/db.py @@ -129,6 +129,17 @@ def get_users_links(domain): return False return result +def get_all_links(): + connection = mysql.connector.connect(**dbargs) + cursor = connection.cursor() + cursor.execute("SELECT * FROM links") + result = cursor.fetchall() + cursor.close() + connection.close() + if result == None: + return False + return result + def get_link(url): connection = mysql.connector.connect(**dbargs) cursor = connection.cursor()