Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP]unexpected T_VARIABLE
Ivanowski
post
Post #1





Grupa: Zarejestrowani
Postów: 51
Pomógł: 0
Dołączył: 7.07.2014

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


Witam. chciałem stworzyć funkcje lecz wyskakuje mi błąd i nie mogę znaleźć błędu. Ktoś pomoże ?
Błąd:
Parse error: syntax error, unexpected T_VARIABLE in MIEJSCE PLIKU on line 76

Kod:
  1. <?
  2.  
  3. class superklasa{
  4.  
  5. function dodaj(
  6. $nazwa, $opis, $numer, $tresc, $background, $komenda1, $komenda2=FALSE, $komenda3=FALSE, $komenda4=FALSE, $komenda5=FALSE) {
  7. //LACZENIE Z BAZA DANYCH
  8. include('config/db_login.php');
  9.  
  10. $endkomendy = '; ';
  11.  
  12. //WYZNACZANIE WARTOSCI $komendy
  13. if(isset($komenda5)) {
  14. $komendy = $komenda1 . $endkomendy . $komenda2 . $endkomendy . $komenda3 . $endkomendy . $komenda4 . $endkomendy . $komenda5;
  15. }elseif(isset($komenda4)) {
  16. $komendy = $komenda1 . $endkomendy . $komenda2 . $endkomendy . $komenda3 . $endkomendy . $komenda4;
  17. }elseif(isset($komenda3)) {
  18. $komendy = $komenda1 . $endkomendy . $komenda2 . $endkomendy . $komenda3;
  19. }elseif(isset($komenda2)) {
  20. $komendy = $komenda1 . $endkomendy . $komenda2;
  21. }elseif(isset($komenda1)) {
  22. $komendy = $komenda1 . $endkomendy;
  23. }
  24.  
  25. //SPRAWDZANIE CZY NUMER MA 1-5 ZNAKOW
  26. if(strlen($numer) <= 5) {
  27.  
  28.  
  29. //SZUKANIE CENY
  30. switch($numer) {
  31.  
  32. case 11111:
  33. $cena = 'cena';
  34. break;
  35.  
  36. }
  37. //WYSYLANIE DO BAZY DANYCH
  38. //WSZYSTKICH INFORMACJI
  39. mysql_query("INSERT INTO tabela('', '".$nazwa."', '".$opis."', '".$cena."', '".$numer."', '".$tresc."', '"$komendy"', '".$background."' )");
  40. }
  41. }
  42.  
  43. }
  44. ?>


Ten post edytował Ivanowski 29.10.2014, 20:14:32
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: 15.09.2025 - 02:23