Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> problem z tabelą
Bastion
post 24.04.2005, 12:09:57
Post #1





Grupa: Zarejestrowani
Postów: 505
Pomógł: 0
Dołączył: 8.01.2005

Ostrzeżenie: (0%)
-----


mam taka tabele :

Kod
a_id INT(8) UNSIGNED NOT NULL AUTO_INCREMENT,
a_name VARCHAR(128) NOT NULL DEFAULT '',
b_id INT(8) UNSIGNED NOT NULL
b_name VARCHAR(128) NOT NULL DEFAULT '',
PRIMARY KEY (a_id),
UNIQUE KEY a_name (a_name)


jak zaoperowac b_id i b_name aby b_id tez bylo primary, a b_name mialo atrybut unique w taki sposob aby dalo sie wprowadzic takie dane :

INSERT INTO tabela SET (a_id, a_name, b_id, b_name) VALUES (1, "aaa", 1, "aaa")
INSERT INTO tabela SET (a_id, a_name, b_id, b_name) VALUES (2, "bbb", 1, "aaa")

ale juz

INSERT INTO tabela SET (a_id, a_name, b_id, b_name) VALUES (2, "bbb", 2, "aaa")
nie ze wzgledu na uniqe b_name


--------------------
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 07:31