Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Insert do dwóch tabel
cursor81
post
Post #1





Grupa: Zarejestrowani
Postów: 11
Pomógł: 0
Dołączył: 9.04.2005

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


witam,

Mam dwie tabele polączene z soba relacja 1-n czy jest możliwość wstawienia do obu tabel jednocześnie
Kod
tabela1                          tabela2
-----------                      ----------------
tabela1_ID PK                tabela2_ID PK(autonumerowanie)
tabela2_ID FK                pole1

(dla wielu rekodów tabela1 istnieje jedno z tabela2)
dla tabeli2: INSERT INTO tabela2 (pole1) VALUES('test')

i teraz bym chciala zeby jak dodaje to pole1 wstawialo mi do tabela1 vartosc tabela2_ID skad moge wiedzec jaka wartosc ma to pole jesli jest ono autonumerowane
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 22.08.2025 - 11:44