Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [MySQL][PHP]Problem z tokenem
Forum PHP.pl > Forum > Przedszkole
monter2313
  1. <html>
  2. <head>
  3. </head>
  4.  
  5. <?
  6. ini_set('display_errors','1');
  7.  
  8.  
  9. $tytul = $_POST['Nazwa'];
  10. $tresc = $_POST['Tresc'];
  11. $miejscowosc = $_POST['Miejscowosc'];
  12. $numer = $_POST['Numer_tel_oferty'];
  13.  
  14. $id = $_GET['id'];
  15. if(file_exists("CONFIG/config.php")) require_once("CONFIG/config.php");
  16. connect();
  17.  
  18. $zapytanie = "UPDATE ".PREFIX."oferty
  19. SET Nazwa_oferty = '$tytul' Tresc_oferty = '$tresc' Miejscowosc_oferty = '$miejscowosc' Numer_tel_oferty = '$numer'
  20. WHERE Id_oferty = '".$_GET['id']."';
  21. $wynik = mysql_query($zapytanie) or die (mysql_error());
  22. close();
  23.  
  24.  
  25. ?>
  26.  
  27.  
  28. <body>
  29. <form method='POST' action='ogloszenia.php'>
  30. <button type="submit" name="Zobacz_ogloszenia" style="background-color: blue; width:400px; height:40px;background-repeat: no-repeat; background-size: 150% 150%;font-size:20pt;color: white; position: relative; left: 0px; top: 240">Zobacz ogloszenia</button>
  31. </form>
  32. </body>
  33. </html>


Błąd Parse error: syntax error, unexpected T_STRING in /home/students/ie2012/magick7/public_html/new/edytuj_oglo2.php on line 31


Oświeci mnie ktoś co za błąd popełniłem... sad.gif PHP byc ciężkie
sadistic_son
Linijka 21:
  1. WHERE Id_oferty = '".$_GET['id']."'";
Forum to nie parser.
monter2313
Notice: Undefined index: id in /home/students/ie2012/magick7/public_html/new/edytuj_oglo2.php on line 15

Notice: Undefined index: id in /home/students/ie2012/magick7/public_html/new/edytuj_oglo2.php on line 21
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Tresc_oferty = 'Spanie' Miejscowosc_oferty = 'Poznan' Numer_tel_oferty = '600600' at line 2

Wybaczcie dopiero się uczę ;/ wstydnis.gif
Majkelo23
  1. WHERE Id_oferty = '".$_GET['id']."';


jak już to:

  1. WHERE Id_oferty = '".$_GET['id']."'";


Ale powinieneś to zapisać tak naprawdę tak:

  1. WHERE Id_oferty = ".$_GET['id'].";


Bo ID to nie string.

A co do drugiego błędu, to po prostu localhost Ci go wywala, na normalnym serwerze będzie ok.

EDIT:
Przecież u góry ktoś podał Ci tą samą odp! Korzystaj chociaż z tego co Ci ludzie piszą...
monter2313

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Tresc_oferty = 'Spanie' Miejscowosc_oferty = 'Poznan' Numer_tel_oferty = '600600' at line 2

Zmieniłem i cały czas to samo

Edit: Juz mi sie udało samemu zmienić problem pozostaje z bazą
Barcelona
Tak się wtrące, po co dajesz w zapytaniu $_GET['id'], skoro zadeklarowałeś
  1. $id = $_GET['id'];
monter2313
Pomyliłem wielkosc tokenów> juz działa
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2024 Invision Power Services, Inc.