Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> prosta wyszukiwarka
dekoder
post
Post #1





Grupa: Zarejestrowani
Postów: 22
Pomógł: 0
Dołączył: 28.05.2007

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


Cześć jestem Franek biggrin.gif

Wyszukiwarka miałaby szukać po tabeli i określonym polu fraze wybrana z listy select



cuś napisałem:

  1. <form action="search.php" method="post">
  2. <select name="impreza"><option value="impreza1">impreza 1</option><option value="impreza2">impreza 2</option></select><BR />
  3. <select name="miejsce"><option value="dyskoteka">dyskoteka</option><option value="pub">pub</option></select><BR />
  4. <select name="termin"><option value="06_07">VI 07</option><option value="07_07">VII 07</option></select><BR />
  5. <input type="submit" value="szukaj">
  6. </form>
  7.  
  8. <? if (!$impreza || !$miejsce || !$termin)
  9. {
  10. print "Wypelnij wszystkie pola";
  11. }
  12.  
  13. @ $db = mysql_pconnect("host", "user", "haslo");
  14. if (!$db)
  15. {
  16. print "blad w polaczeniu";
  17. }
  18.  
  19.  
  20. $query = " select * from jakastabela ".$impreza." and ".$miejsce." and ".$termin.";
  21. $result = mysql_query($query);
  22. $num_results = mysql_num_rows($result);
  23.  
  24. print "<p>Ilosc znalezionych fraz : " .$num_results."</p>";
  25. for ($i=0; $i <$num_results; $i++) {
  26. $row = mysql_fetch_array($result);
  27. print ($i+1).". ";
  28. print stripslashes($row["header"]);
  29. print ", naglowek: ";
  30. print stripslashes($row["header2"]);
  31. print " tresc ,data:";
  32. print stripslashes($row["termin"]);
  33. print "<BR />";
  34. }
  35. ?>


wyskakuje Parse error: parse error, unexpected '\"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /www/search.php on line 27

helpy

Ten post edytował dekoder 1.06.2007, 08:45:41
Go to the top of the page
+Quote Post

Posty w temacie


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 Aktualny czas: 19.08.2025 - 02:10