Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP MYSQL] Wyrzuca z bazy 1 wyraz
--roguś--
post
Post #1





Goście







Witam. Mam problem ponieważ gdy losuje wyraz z bazy a sklada się on z 2 członów to wyrzuca mi tylko ten pierwszy :/ np : samochód osobowy -> samochód
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 4)
terabit
post
Post #2





Grupa: Zarejestrowani
Postów: 170
Pomógł: 4
Dołączył: 11.08.2006

Ostrzeżenie: (10%)
X----


pokaz kod, może wtedy pomożemy (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)
Go to the top of the page
+Quote Post
-yab-
post
Post #3





Goście







Witam,
Najlepiej jakbys wkleil tu skrypt ktorego uzywasz.
Pozdrawiam
Go to the top of the page
+Quote Post
--roguś--
post
Post #4





Goście







urywek kodu , reszta raczej nie powinna mnieć nic do tego
  1. <?php
  2. $wybierz = mysql_query("SELECT * FROM slowa
  3.  WHERE login='$in' AND
  4.  kategoria='$kategoria' 
  5.  ORDER BY RAND() LIMIT 1")
  6. or die (mysql_error()); 
  7.  
  8.  
  9.  
  10. while ($row = mysql_fetch_array($wybierz))
  11. {
  12. echo '<form method=post>Słowo po polsku: <b>'.$row["tlumaczenie"].'</b> Tłumaczenie: <input type=text name=slowousera>';
  13. echo '<input type=hidden value='.$row["verb"].'>
  14. <input type=hidden name=sl value='.$row["slowo"].'>
  15. <input type=hidden name=ve value='.$row["tlumaczenie"].'>
  16. <input type=hidden name=sa value=ok><input type=submit></form>';
  17. ?>
Go to the top of the page
+Quote Post
-rogus-
post
Post #5





Goście







Zauważylem pewna zależność
  1. <?php
  2. $wybierz = mysql_query("SELECT * FROM slowa
  3.  WHERE login='$in' AND
  4.  kategoria='$kategoria' 
  5.  ORDER BY RAND() LIMIT 1")
  6. or die (mysql_error()); 
  7.  
  8.  
  9.  
  10. while ($row = mysql_fetch_array($wybierz))
  11. {
  12. echo '<form method=post>Słowo po polsku: <b>'.$row["tlumaczenie"].' // Tutaj wyświetla 2 slowa
  13. </b> <br>Tłumaczenie: <input type=text name=slowousera>';
  14. echo '<input type=hidden value='.$row["verb"].'>
  15. <input type=hidden name=sl value='.$row["slowo"].'>
  16. <input type=hidden name=ve value='.$row["tlumaczenie"].'><br>
  17. <input type=hidden name=sa value=ok><input type=submit></form>';
  18. }
  19.  
  20.  
  21. if ($_POST['sa'] == ok) {
  22. echo '<b>';
  23. echo $_POST["sl"]; // Odtąd natomiast tylko jedno
  24. echo ' - ';
  25. echo $_POST["ve"];
  26. echo '</b>';
  27. $slowousera = $_POST['slowousera'];
  28. $slowko = $_POST['sl'];
  29. $wyraz = $_POST['ve'];
  30. $katy = $_GET['na'];
  31. $pominiete = pominiete;
  32. echo '</td><td>';
  33. ?>
Go to the top of the page
+Quote Post

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: 23.08.2025 - 06:52