Lotto2PY/datum.py
2025-10-19 17:46:58 +02:00

33 lines
No EOL
878 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import pymysql
# --- Verbindung herstellen ---
connection = pymysql.connect(
host='10.0.1.123',
user='hubobel',
password='polier2003',
database='hubobel',
charset='utf8mb4',
cursorclass=pymysql.cursors.Cursor
)
try:
with connection.cursor() as cursor:
# Beispielwerte
z1, z2, z3, z4, z5 = 10, 22, 38, 42, 48
# --- Prüfabfrage: existiert diese Kombination? ---
sql_check = """
SELECT 1 FROM `euro`
WHERE z1 = %s AND z2 = %s AND z3 = %s AND z4 = %s AND z5 = %s
LIMIT 1
"""
cursor.execute(sql_check, (z1, z2, z3, z4, z5))
exists = cursor.fetchone() is not None
if exists:
print("✅ Kombination existiert bereits.")
else:
print("🆕 Kombination ist neu kann eingefügt werden.")
finally:
connection.close()