Найти в Дзене
bd
-- Создание и использование схемы DROP SCHEMA IF EXISTS `shoe_store_db`; CREATE SCHEMA `shoe_store_db` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; USE `shoe_store_db`; -- 1. Роли CREATE TABLE roles ( role_id INT AUTO_INCREMENT PRIMARY KEY, role_name VARCHAR(50) NOT NULL UNIQUE ) ENGINE=InnoDB; -- 2. Пользователи CREATE TABLE users ( user_id INT AUTO_INCREMENT PRIMARY KEY, login VARCHAR(50) NOT NULL UNIQUE, password_hash VARCHAR(255) NOT NULL, role_id INT NOT NULL, full_name VARCHAR(150) NOT NULL, FOREIGN KEY (role_id) REFERENCES roles(role_id) ON DELETE RESTRICT ) ENGINE=InnoDB; -- 3...
4 дня назад
demo32
main import tkinter as tk from tkinter import ttk, messagebox, filedialog import pymysql import os from PIL import Image, ImageTk # --- КОНФИГУРАЦИЯ --- DB_CONFIG = { 'host': 'localhost', 'user': 'root', # ЗАМЕНИТЕ на вашего пользователя MySQL 'password': '12345',# ЗАМЕНИТЕ на ваш пароль MySQL 'database': 'shoe_store_db', 'cursorclass': pymysql.cursors.DictCursor, 'charset': 'utf8mb4' } DEFAULT_IMAGE_PATH = "picture.png" IMAGES_FOLDER = "images" class Database: def __init__(self): self.conn = None self.connect() def connect(self): try: self.conn = pymysql.connect(**DB_CONFIG) except pymysql...
4 дня назад
ИРСА0000
main import tkinter as tk from tkinter import messagebox import mysql.connector # ---------------- DB ---------------- conn = mysql.connector.connect( host="localhost", user="root", password="12345", database="shop" ) cur = conn.cursor(dictionary=True) # ---------------- SQL ---------------- def login_user(login, password): cur.execute( "SELECT * FROM users WHERE login=%s AND password=%s", (login, password) ) return cur.fetchone() def get_products(): cur.execute("SELECT * FROM products") return cur.fetchall() def search_products(text): cur.execute(""" SELECT * FROM products WHERE name LIKE %s OR category LIKE %s OR supplier LIKE %s """, (f"%{text}%", f"%{text}%", f"%{text}%")) return cur...
4 дня назад
Why not go to the museum of "Shishkin's paintings" in Yaroslavl
Recently I went to the Shishkin Museum, where we were shown many paintings by the famous artist. In general, the museum is not bad: inside it is quite beautiful and harmonious, there is a comfortable wardrobe, several spacious rooms where Shishkin's paintings hang. However, if you go to the museum of famous paintings by a famous artist in order to see famous paintings by a famous artist, then unfortunately they will not be able to satisfy your desire here. Basically, the museum tells about the creative...
3 года назад
Gouache
Gouache, the French word is water paint, splash, more dense and matte than watercolor. The composition includes finely ground pigments based on a water-glue mixture (gum arabic, wheat starch, dextrin and others) also, the paint contains impurities of whitewash (chalk). This ancient method of painting, representing one of the varieties of watercolor, was first developed in the works of the artist Paolo Pino. Nowadays it has become popular again and is used both on paper and on silk and other materials...
3 года назад
Если нравится — подпишитесь
Так вы не пропустите новые публикации этого канала