Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> zabawa array
acztery
post 19.02.2007, 00:31:53
Post #1





Grupa: Zarejestrowani
Postów: 945
Pomógł: 7
Dołączył: 15.03.2005
Skąd: katowice

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


mam taki klopot. jak zrobić z tego:

Kod
Array
(
    [failed] => Array
        (
            [0] => Array
                (
                    [Id] => 1
                    [Name] => Title
                    [Label] => pole numer 1
                    [Type] => text
                    [FromId] => 1
                    [Extra] =>
                    [Ord] =>
                    [Default_value] =>
                    [Time] => 5454545454
                    [Date] => 4 luty
                    [Deleted] => N
                    [Required] => N
                )

        )

    [data] => Array
        (
            [0] => Array
                (
                    [Id] => 1
                    [UserId] => Ux1
                    [FromId] => 1
                    [Time] => 43434343
                    [value] => dupa 1
                )
        )

)


takie coś:

Kod
Array
(
    [failed] => Array
        (
            [0] => Array
                (
                    [Id] => 1
                    [Name] => Title
                    [Label] => pole numer 1
                    [Type] => text
                    [FromId] => 1
                    [Extra] =>
                    [Ord] =>
                    [Default_value] =>
                    [Time] => 5454545454
                    [Date] => 4 luty
                    [Deleted] => N
                    [Required] => N
                    [Id_data] => 1
                    [UserId_data] => Ux1
                    [FromId_data] => 1
                    [Time_data] => 43434343
                    [value_data] => dupa 1
                )
        )

)


mam takie coś:

  1. <?php
  2. public function generateFrom($_fromId,$_parent='')
  3. {
  4. $db = parent::Connect();
  5. $db->query("set names 'utf8'");
  6. $db->whereAdd("FromId = '$_fromId'");
  7. $db->find();
  8. while($db->fetch()) {
  9. $arrFrom['failed'][] = $db->toArray();
  10. }
  11. $dbData = parent::ConnectData();
  12. $dbData->query("set names 'utf8'");
  13. $dbData->whereAdd("FromId = '$_fromId'");
  14. $dbData->whereAdd("UserId = '$_parent'");
  15. $dbData->find();
  16. while($dbData->fetch()) {
  17. $arrData['data'][] = $dbData->toArray();
  18. }
  19. return $arrFrom+$arrData; 
  20. }
  21. ?>


Ten post edytował acztery 19.02.2007, 00:32:36
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
MrMag
post 19.02.2007, 00:46:52
Post #2





Grupa: Zarejestrowani
Postów: 154
Pomógł: 5
Dołączył: 24.02.2004

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


array_merge ?


--------------------
Go to the top of the page
+Quote Post
Cienki1980
post 19.02.2007, 07:43:30
Post #3





Grupa: Przyjaciele php.pl
Postów: 1 590
Pomógł: 40
Dołączył: 11.01.2007
Skąd: Centrum

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


Zamykam
Proszę o zapoznanie się z Tematyka i Zasadami panującymi na forum Przedszkole i wysłać mi na PW poprawny tag tematu.
Jeżeli PW dostanę temat zostanie otwarty


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

Closed 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: 19.07.2025 - 14:52