Aktualisierung

This commit is contained in:
hubobel 2025-10-19 17:46:58 +02:00
parent bebb0a0aa5
commit 47ebaa4fcd
10 changed files with 180 additions and 0 deletions

33
datum.py Normal file
View file

@ -0,0 +1,33 @@
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()