![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 4 Pomógł: 0 Dołączył: 9.11.2009 Ostrzeżenie: (0%) ![]() ![]() |
Witam
Od razu pisze że nie mam zielonego pojęcia nt. programowania w PHP problem polega na tym że wgrałem templatkę do zainstalowanego CMSa i w poglądzie wywala mi błąd na stronie a mianowicie: Warning: Invalid argument supplied for foreach() in /homepages/.........../Base.class.php on line 152 Poniżej kod PHP pliku Base.class.php
Proszę o pomoc bo kompletnie się nie znam na tym ![]() ![]() |
|
|
![]()
Post
#2
|
|
![]() Grupa: Moderatorzy Postów: 4 069 Pomógł: 497 Dołączył: 11.05.2007 Skąd: Warszawa ![]() |
Invalid argument supplied for foreach()
Czyli to co dajesz w foreach nie jest tablicą. Daj var_dump($rows); przed pętlą i zobacz co tam masz. |
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 4 Pomógł: 0 Dołączył: 9.11.2009 Ostrzeżenie: (0%) ![]() ![]() |
a czy możesz napisac w której linijce to mam wstawic bo jak pisałem na samym początku nie mam zielonego pojęcia
![]() |
|
|
![]()
Post
#4
|
|
![]() Grupa: Zarejestrowani Postów: 156 Pomógł: 31 Dołączył: 23.02.2009 Skąd: Sanok Ostrzeżenie: (0%) ![]() ![]() |
Przed foreach w 152 lini
|
|
|
![]()
Post
#5
|
|
![]() Grupa: Zarejestrowani Postów: 69 Pomógł: 0 Dołączył: 22.01.2011 Skąd: Murowana Goślina Ostrzeżenie: (0%) ![]() ![]() |
|
|
|
![]()
Post
#6
|
|
Grupa: Zarejestrowani Postów: 4 Pomógł: 0 Dołączył: 9.11.2009 Ostrzeżenie: (0%) ![]() ![]() |
Przed foreach w 152 lini Wstawiłem ta linijkę to mi błędy wyskoczyły a konkretnie cała litania Kod array(3) { [0]=> object(stdClass)#105 (25) { ["id"]=> string(1) "1" ["menutype"]=> string(8) "mainmenu" ["name"]=> string(15) "Strona gĹĂłwna" ["alias"]=> string(5) "start" ["link"]=> string(43) "index.php?option=com_content&view=frontpage" ["type"]=> string(9) "component" ["published"]=> string(1) "1" ["parent"]=> string(1) "0" ["componentid"]=> string(2) "20" ["sublevel"]=> string(1) "0" ["ordering"]=> string(1) "1" ["checked_out"]=> string(1) "0" ["checked_out_time"]=> string(19) "0000-00-00 00:00:00" ["pollid"]=> string(1) "0" ["browserNav"]=> string(1) "0" ["access"]=> string(1) "0" ["utaccess"]=> string(1) "3" ["params"]=> string(548) "num_leading_articles=5 num_intro_articles=1 num_columns=1 num_links=1 orderby_pri= orderby_sec=front multi_column_order=1 show_pagination=2 show_pagination_results=1 show_feed_link=1 show_noauth= show_title= link_titles= show_intro= show_section= link_section= show_category= link_category= show_author= show_create_date= show_modify_date= show_item_navigation=1 show_readmore= show_vote= show_icons=0 show_pdf_icon=0 show_print_icon=0 show_email_icon=0 show_hits= feed_summary= page_title= show_page_title=1 pageclass_sfx= menu_image=-1 secure=0 " ["lft"]=> string(1) "0" ["rgt"]=> string(1) "0" ["home"]=> string(1) "1" ["component"]=> string(11) "com_content" ["tree"]=> array(1) { [0]=> string(1) "1" } ["route"]=> string(5) "start" ["query"]=> array(2) { ["option"]=> string(11) "com_content" ["view"]=> string(9) "frontpage" } } [1]=> object(stdClass)#108 (25) { ["id"]=> string(1) "3" ["menutype"]=> string(8) "mainmenu" ["name"]=> string(9) "Logowanie" ["alias"]=> string(9) "logowanie" ["link"]=> string(36) "index.php?option=com_user&view=login" ["type"]=> string(9) "component" ["published"]=> string(1) "1" ["parent"]=> string(1) "0" ["componentid"]=> string(2) "14" ["sublevel"]=> string(1) "0" ["ordering"]=> string(1) "3" ["checked_out"]=> string(1) "0" ["checked_out_time"]=> string(19) "0000-00-00 00:00:00" ["pollid"]=> string(1) "0" ["browserNav"]=> string(1) "0" ["access"]=> string(1) "0" ["utaccess"]=> string(1) "0" ["params"]=> string(370) "show_login_title=1 header_login= login= login_message=0 description_login=0 description_login_text= image_login= image_login_align=right show_logout_title=1 header_logout= logout= logout_message=1 description_logout=1 description_logout_text=ZostaĹeĹ poprawnie wylogowany. DziÄkujemy image_logout= page_title= show_page_title=1 pageclass_sfx= menu_image=-1 secure=0 " ["lft"]=> string(1) "0" ["rgt"]=> string(1) "0" ["home"]=> string(1) "0" ["component"]=> string(8) "com_user" ["tree"]=> array(1) { [0]=> string(1) "3" } ["route"]=> string(9) "logowanie" ["query"]=> array(2) { ["option"]=> string(8) "com_user" ["view"]=> string(5) "login" } } [2]=> object(stdClass)#110 (25) { ["id"]=> string(1) "4" ["menutype"]=> string(8) "mainmenu" ["name"]=> string(11) "Rejestracja" ["alias"]=> string(11) "rejestracja" ["link"]=> string(39) "index.php?option=com_user&view=register" ["type"]=> string(9) "component" ["published"]=> string(1) "1" ["parent"]=> string(1) "0" ["componentid"]=> string(2) "14" ["sublevel"]=> string(1) "0" ["ordering"]=> string(1) "4" ["checked_out"]=> string(1) "0" ["checked_out_time"]=> string(19) "0000-00-00 00:00:00" ["pollid"]=> string(1) "0" ["browserNav"]=> string(1) "0" ["access"]=> string(1) "0" ["utaccess"]=> string(1) "0" ["params"]=> string(69) "page_title= show_page_title=1 pageclass_sfx= menu_image=-1 secure=0 " ["lft"]=> string(1) "0" ["rgt"]=> string(1) "0" ["home"]=> string(1) "0" ["component"]=> string(8) "com_user" ["tree"]=> array(1) { [0]=> string(1) "4" } ["route"]=> string(11) "rejestracja" ["query"]=> array(2) { ["option"]=> string(8) "com_user" ["view"]=> string(8) "register" } } } NULL Warning: Invalid argument supplied for foreach() in /homepages/........./Base.class.php on line 153 Nie wiem za co ten kawałek kodu był odpowiedzialny ale usunąłem tą linijkę czyli: foreach ($rows as $index => $v) { oraz gdzieś tam niżej } i działa nie wywala błędów ![]() |
|
|
![]()
Post
#7
|
|
![]() Grupa: Zarejestrowani Postów: 69 Pomógł: 0 Dołączył: 22.01.2011 Skąd: Murowana Goślina Ostrzeżenie: (0%) ![]() ![]() |
shit, w takim bałaganie to ja się nie połapię =/
foreach sluzy do tworzenia kluczy (zapewne wiesz) np: czyli twoim bledem bylo to chyba ze nie dales tablicy albo nie wyswietliles tablicy zmiennej ![]()
...dostaniesz buziaka od każdej z babci za pomoca foreach ![]() niestety w kodzie cos twoim nie wiem o co chodzi, wiec tlyk ci przedstawilem dzialanie foreach. Ten post edytował waqmaz 2.02.2011, 13:18:39 |
|
|
![]() ![]() |
![]() |
Aktualny czas: 20.08.2025 - 15:15 |