Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP]Przenoszenie pola z jednej tabeli do drugiej.
Klycior
post
Post #1





Grupa: Zarejestrowani
Postów: 116
Pomógł: 2
Dołączył: 31.05.2009

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


Witam,

W members mam pole o nazwie dolar oraz pole odpowiadające za id czyli member_id.
Chciałbym przenieść to pole do tabeli pfields_content pod nazwą field_12 (Takie samo pole ID).

Jak czegoś takiego dokonać ?

Dodam że w tabeli members mam jeszcze kilka innych pól.

Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




http://dev.mysql.com/doc/refman/5.0/en/update.html
i przykład z tej strony:
Cytat
You can also perform UPDATE operations covering multiple tables. However, you cannot use ORDER BY or LIMIT with a multiple-table UPDATE. The table_references clause lists the tables involved in the join. Its syntax is described in Section 12.2.8.1, “JOIN Syntax”. Here is an example:
UPDATE items,month SET items.price=month.price
WHERE items.id=month.id;
Go to the top of the page
+Quote Post

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: 23.08.2025 - 17:52