Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP] Błęd przy zapisie do bazy danych
pawel06281990
post 23.07.2019, 12:35:33
Post #1





Grupa: Zarejestrowani
Postów: 281
Pomógł: 0
Dołączył: 10.01.2014

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


Witam dostałem takie komunikaty a wszystko zrobiłem poprawnie.



  1. Use of undefined constant DB_POKAZ_ZDJEC - assumed 'DB_POKAZ_ZDJEC' Linia: 50 lipiec 23 2019 12:26:54
  2. slider/infusion.php
  3. Use of undefined constant DB_POKAZ_ZDJEC - assumed 'DB_POKAZ_ZDJEC' Linia: 52 lipiec 23 2019 12:26:54
  4. slider/infusion.php
  5. include(../infusions/slider/infusion_db.php): failed to open stream: No such file or directory Linia: 21 lipiec 23 2019 12:26:54
  6. slider/infusion.php
  7. Use of undefined constant DB_POKAZ_ZDJEC - assumed 'DB_POKAZ_ZDJEC' Linia: 43


a tak wygląda plikinfusion.php
  1. if (!defined("IN_FUSION")) { die("Access Denied"); }
  2.  
  3. include INFUSIONS."slider/infusion_db.php";
  4.  
  5. // Check if locale file is available matching the current site locale setting.
  6. if (file_exists(INFUSIONS."slider/locale/".$settings['locale'].".php")) {
  7. // Load the locale file matching the current site locale setting.
  8. include INFUSIONS."slider/locale/".$settings['locale'].".php";
  9. } else {
  10. // Load the infusion's default locale file.
  11. include INFUSIONS."slider/locale/English.php";
  12. }
  13.  
  14. // Infusion general information
  15. $inf_title = $locale['001_nazwa'];
  16. $inf_description = $locale['002_opis'];
  17. $inf_version = "1.0";
  18. $inf_developer = "E-comp";
  19. $inf_email = "programista@twoj-host.pl";
  20. $inf_weburl = "http://e-comp.net.pl";
  21. $inf_folder = "slider";
  22. $inf_image = "slider.svg";
  23.  
  24. // Delete any items not required below.
  25. $inf_newtable[1] = DB_POKAZ_ZDJEC." (
  26. slide_setting_id smallint(6) NOT NULL,
  27. slide_setting_wlacz_slide tinyint(4) NOT NULL DEFAULT 0,
  28. slide_setting_obrazek_tlo varchar(250) NOT NULL,
  29. slide_setting_version varchar(250) NOT NULL DEFAULT '1.0'
  30. ) ENGINE=MyISAM DEFAULT CHARSET=latin1";
  31.  
  32. $inf_insertdbrow[1] = DB_POKAZ_ZDJEC."(slide_setting_wlacz_slide, slide_setting_obrazek_tlo, slide_setting_version ) VALUES (1, '', '1.0')";
  33.  
  34. $inf_droptable[1] = DB_POKAZ_ZDJEC;
  35.  
  36.  
  37.  
  38. $inf_adminpanel[1] = array(
  39. "title" => $locale['020_admin'],
  40. "image" => "../../infusions/slider/slider.svg",
  41. "panel" => "slider_admin.php",
  42. "rights" => "SLI"
  43. );


a tak wygląda plik infusdion_db.php

  1. if (!defined("IN_FUSION")) { die("Access Denied"); }
  2.  
  3. if (!defined("DB_POKAZ_ZDJEC")) {
  4. define("DB_POKAZ_ZDJEC", DB_PREFIX."pokaz zdjec_setting");
  5. }


Co jest nie tak w pliku questionmark.gif

Ten post edytował pawel06281990 23.07.2019, 12:47:25
Go to the top of the page
+Quote Post
kapslokk
post 23.07.2019, 13:32:35
Post #2





Grupa: Zarejestrowani
Postów: 965
Pomógł: 285
Dołączył: 19.06.2015
Skąd: Warszawa

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


Ścieżka do pliku infusion_db.php jest niepoprawna, przez co skrypt nie definiuje stałych i pojawiają się pozostałe błedy.
Go to the top of the page
+Quote Post
pawel06281990
post 23.07.2019, 14:13:35
Post #3





Grupa: Zarejestrowani
Postów: 281
Pomógł: 0
Dołączył: 10.01.2014

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


Ale folder który mam jest /infusions/slider.

Infusion to folder doleclowy a folder slider to folder w którym mam tą wtyczkę.
Go to the top of the page
+Quote Post
kapslokk
post 23.07.2019, 14:39:05
Post #4





Grupa: Zarejestrowani
Postów: 965
Pomógł: 285
Dołączył: 19.06.2015
Skąd: Warszawa

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


Domyślam się, że w stałej INFUSIONS masz '../infusions/'. Jesteś pewien, że w pliku, który tutaj podajesz ta ścieżka jest prawidłowa? Pamiętaj, że do include musisz przekazać ścieżkę względem pliku, w którym używasz tego include. Być może korzystanie ze ścieżki bezwzględnej w stałej INFUSIONS rozwiąże Twój problem.
Go to the top of the page
+Quote Post
pawel06281990
post 23.07.2019, 15:07:59
Post #5





Grupa: Zarejestrowani
Postów: 281
Pomógł: 0
Dołączył: 10.01.2014

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


Ok wiem czemu to była przyczyna.

Przy tworzeniu wtyczki zapomniałem dodać ścieżkę do głównego pliku zarzadzania w tyczką czyli np.admin.php dodałem sobie i teraz działa jak powinno
Go to the top of the page
+Quote Post

Reply to this 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.04.2024 - 22:59