![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 55 Pomógł: 0 Dołączył: 22.05.2015 Ostrzeżenie: (0%) ![]() ![]() |
Cześć.
W bazie danych takie tabele jak: - samochód (marka, model itd.) - pracownik (imię, nazwisko itd.) Zrobiłem formularz, w którym wybieram z listy samochód i podaję ilość przejechanych nim kilometrów oraz wybór z listy pracownika i podanie ilości przepracowanych przez niego godzin. Przykład: Samochód: VW Polo Ilość przejechanych km: 50 Pracownik: Adam Nowak Ilość przepracowanych godzin: 8 Pytanie jak zrobić by bo wysłaniu formularza do bazy wyliczyło mi koszty. Zakładając że przejechany 1 km = 1 PLN, przepracowana 1h = 10 PLN. W sumie koszt powinien wyjść 130 PLN i ma pokazać się w bazie. |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 55 Pomógł: 0 Dołączył: 22.05.2015 Ostrzeżenie: (0%) ![]() ![]() |
Dosyć sporo błędów.
Kod object(PDOException)#9 (8) { ["message":protected]=> string(67) "SQLSTATE[HY093]: Invalid parameter number: no parameters were bound" ["string":"Exception":private]=> string(0) "" ["code":protected]=> string(5) "HY093" ["file":protected]=> string(71) "/httpdocs/zlecenie/models/Resources.php" ["line":protected]=> int(31) ["trace":"Exception":private]=> array(8) { [0]=> array(6) { ["file"]=> string(71) "/httpdocs/zlecenie/models/Resources.php" ["line"]=> int(31) ["function"]=> string(7) "execute" ["class"]=> string(12) "PDOStatement" ["type"]=> string(2) "->" ["args"]=> array(0) { } } [1]=> array(6) { ["file"]=> string(75) "/httpdocs/zlecenie/controllers/Homepage.php" ["line"]=> int(13) ["function"]=> string(11) "getEmployee" ["class"]=> string(9) "Resources" ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> string(2) "18" } } [2]=> array(6) { ["file"]=> string(64) "/httpdocs/zlecenie/core/Form.php" ["line"]=> int(14) ["function"]=> string(9) "{closure}" ["class"]=> string(8) "Homepage" ["type"]=> string(2) "::" ["args"]=> array(0) { } } [3]=> array(6) { ["file"]=> string(75) "/httpdocs/zlecenie/controllers/Homepage.php" ["line"]=> int(24) ["function"]=> string(4) "post" ["class"]=> string(4) "Form" ["type"]=> string(2) "::" ["args"]=> array(2) { [0]=> array(5) { [0]=> string(13) "id_pracownika" [1]=> string(12) "id_samochodu" [2]=> string(9) "kilometry" [3]=> string(5) "koszt" [4]=> string(14) "czas" } [1]=> object(Closure)#4 (0) { } } } [4]=> array(6) { ["file"]=> string(61) "/httpdocs/zlecenie/Routes.php" ["line"]=> int(12) ["function"]=> string(5) "index" ["class"]=> string(8) "Homepage" ["type"]=> string(2) "::" ["args"]=> array(0) { } } [5]=> array(4) { ["file"]=> string(65) "/httpdocs/zlecenie/core/Route.php" ["line"]=> int(25) ["function"]=> string(9) "{closure}" ["args"]=> array(0) { } } [6]=> array(6) { ["file"]=> string(61) "/httpdocs/zlecenie/Routes.php" ["line"]=> int(13) ["function"]=> string(3) "set" ["class"]=> string(5) "Route" ["type"]=> string(2) "::" ["args"]=> array(2) { [0]=> string(1) "/" [1]=> object(Closure)#2 (0) { } } } [7]=> array(4) { ["file"]=> string(60) "/httpdocs/zlecenie/index.php" ["line"]=> int(12) ["args"]=> array(1) { [0]=> string(61) "/httpdocs/zlecenie/Routes.php" } ["function"]=> string(12) "require_once" } } ["previous":"Exception":private]=> NULL ["errorInfo"]=> array(2) { [0]=> string(5) "HY093" [1]=> int(0) } }
Notice: Use of undefined constant employee - assumed 'employee' in /httpdocs/zlecenie/controllers/Homepage.php on line 15 Warning: Illegal string offset 'stawka' in /httpdocs/zlecenie/controllers/Homepage.php on line 15 object(PDOException)#10 (8) { ["message":protected]=> string(67) "SQLSTATE[HY093]: Invalid parameter number: no parameters were bound" ["string":"Exception":private]=> string(0) "" ["code":protected]=> string(5) "HY093" ["file":protected]=> string(71) "/httpdocs/zlecenie/models/Resources.php" ["line":protected]=> int(66) ["trace":"Exception":private]=> array(8) { [0]=> array(6) { ["file"]=> string(71) "/httpdocs/zlecenie/models/Resources.php" ["line"]=> int(66) ["function"]=> string(7) "execute" ["class"]=> string(12) "PDOStatement" ["type"]=> string(2) "->" ["args"]=> array(0) { } } [1]=> array(6) { ["file"]=> string(75) "/httpdocs/zlecenie/controllers/Homepage.php" ["line"]=> int(16) ["function"]=> string(6) "getCar" ["class"]=> string(9) "Resources" ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> string(1) "6" } } [2]=> array(6) { ["file"]=> string(64) "/httpdocs/zlecenie/core/Form.php" ["line"]=> int(14) ["function"]=> string(9) "{closure}" ["class"]=> string(8) "Homepage" ["type"]=> string(2) "::" ["args"]=> array(0) { } } [3]=> array(6) { ["file"]=> string(75) "/httpdocs/zlecenie/controllers/Homepage.php" ["line"]=> int(24) ["function"]=> string(4) "post" ["class"]=> string(4) "Form" ["type"]=> string(2) "::" ["args"]=> array(2) { [0]=> array(5) { [0]=> string(13) "id_pracownika" [1]=> string(12) "id_samochodu" [2]=> string(9) "kilometry" [3]=> string(5) "koszt" [4]=> string(14) "czas" } [1]=> object(Closure)#4 (0) { } } } [4]=> array(6) { ["file"]=> string(61) "/httpdocs/zlecenie/Routes.php" ["line"]=> int(12) ["function"]=> string(5) "index" ["class"]=> string(8) "Homepage" ["type"]=> string(2) "::" ["args"]=> array(0) { } } [5]=> array(4) { ["file"]=> string(65) "/httpdocs/zlecenie/core/Route.php" ["line"]=> int(25) ["function"]=> string(9) "{closure}" ["args"]=> array(0) { } } [6]=> array(6) { ["file"]=> string(61) "/httpdocs/zlecenie/Routes.php" ["line"]=> int(13) ["function"]=> string(3) "set" ["class"]=> string(5) "Route" ["type"]=> string(2) "::" ["args"]=> array(2) { [0]=> string(1) "/" [1]=> object(Closure)#2 (0) { } } } [7]=> array(4) { ["file"]=> string(60) "/httpdocs/zlecenie/index.php" ["line"]=> int(12) ["args"]=> array(1) { [0]=> string(61) "/httpdocs/zlecenie/Routes.php" } ["function"]=> string(12) "require_once" } } ["previous":"Exception":private]=> NULL ["errorInfo"]=> array(2) { [0]=> string(5) "HY093" [1]=> int(0) } } Notice: Use of undefined constant car - assumed 'car' in /httpdocs/zlecenie/controllers/Homepage.php on line 18 Warning: Illegal string offset 'koszt_km' in /httpdocs/zlecenie/controllers/Homepage.php on line 18 int(0) |
|
|
![]() ![]() |
![]() |
Aktualny czas: 8.10.2025 - 03:44 |