Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Po dodaniu zmiennej serwis się sypie, dlaczego?
kisiel_665
post
Post #1





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 12.10.2010

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


Witam, chciałbym zedytować trochę funkcję aby dodać więcej zmiennych. funkcja wygląda tak:
  1. function addPack ( $name, $day, $amount, $mysql )
  2. {
  3. $sql = "INSERT INTO `rs` (`rsName`, `rsDay`, `rsAmount`) VALUES ('$name', '$day', '$amount')";
  4. $mysql -> q( $sql );
  5. }


Zmieniłem ją, tak aby wyglądała tak:
  1. function addPack ( $name, $opis, $day, $amount, $mysql )
  2. {
  3. $sql = "INSERT INTO `rs` (`rsName`, `rsOpis`, `rsDay`, `rsAmount`) VALUES ('$name', '$opis', '$day', '$amount')";
  4. $mysql -> q( $sql );
  5. }


Nigdzie nie używałem jeszcze nowej zmiennej, a przy korzystaniu z tej funkcji w serwisie pojawia się błąd:
Warning: Missing argument 5 for admin::addPack(), called in /home/rscenter/domains/rs-center.pl/public_html/modules/admin-pack.mod.php on line 12 and defined in /home/rscenter/domains/rs-center.pl/public_html/class/admin.class.php on line 123

Catchable fatal error: Object of class sql_db could not be converted to string in /home/rscenter/domains/rs-center.pl/public_html/class/admin.class.php on line 125

Wie może ktoś dlaczego tak się dzieje? Z góry dziękuje za pomoc.



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: 16.10.2025 - 04:31