Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP]Tabela do tablicy
cisu
post
Post #1





Grupa: Zarejestrowani
Postów: 157
Pomógł: 1
Dołączył: 15.03.2008
Skąd: Mirostowice Dolne

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


Witam. Tym razem mam taki problem. Chciałbym zrzucić moją tabelkę w bazie danych do tablicy o strukturze:
  1. $table = array(
  2. array('folder_id' => 00000000001, 'name' => 'AAA', 'folder_parent' => '00000000000'),
  3. array('folder_id' => 00000000002, 'name' => 'BBB', 'folder_parent' => '00000000001'),
  4. array('folder_id' => 00000000003, 'name' => 'CCC', 'folder_parent' => '00000000002'),
  5. array('folder_id' => 00000000004, 'name' => 'DDD', 'folder_parent' => '00000000002'),
  6. array('folder_id' => 00000000005, 'name' => 'EEE', 'folder_parent' => '00000000002'),
  7. array('folder_id' => 00000000006, 'name' => 'FFF', 'folder_parent' => '00000000001'),
  8. array('folder_id' => 00000000007, 'name' => 'GGG', 'folder_parent' => '00000000006'),
  9. array('folder_id' => 00000000008, 'name' => 'HHH', 'folder_parent' => '00000000006'),
  10. array('folder_id' => 00000000009, 'name' => 'III', 'folder_parent' => '00000000000')
  11. );
Tabelka
  1. folder_id folder_name folder_parent
  2. 00000000001 AAA 00000000000
  3. 00000000002 BBB 00000000001
  4. 00000000003 CCC 00000000002
  5. 00000000004 DDD 00000000002
  6. 00000000005 EEE 00000000002
  7. 00000000006 FFF 00000000001
  8. 00000000007 GGG 00000000006
  9. 00000000008 HHH 00000000006
  10. 00000000009 III 00000000000

Chodzi mi o to, żeby zrobić to za pomocą jednego zapytania do bazy danych. Proszę o pomoc.

Ten post edytował cisu 8.06.2011, 16:30:15
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: 29.09.2025 - 19:01