| 12345678910111213 |
- from app.core.config import settings
- import mysql.connector
- if __name__ == '__main__':
- cnx = mysql.connector.connect(**settings.DATABASE_CONFIG_WITH_DB)
- cursor = cnx.cursor()
- query = f"SELECT IFNULL(img_name, img_result_json) AS img_result_json FROM {settings.DB_TABLE_NAME} WHERE img_id = %s"
- cursor.execute(query, (3,))
- result = cursor.fetchone()
- print(result)
|