Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]Formularz-pobieranie danych z kolumn
daros17
post
Post #1





Grupa: Zarejestrowani
Postów: 233
Pomógł: 27
Dołączył: 27.08.2007

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


Mam taki problem, że pobiera mi z kolumny tylko 1 rekord a nie wszystkie. w tej chwili ma 2 rekordy w kolumnie. Ciekawe jest to, że pokazuje mi nie pierwszy rekord tylko ten2. Co trzeba poprawić? jakaś pętla?
  1. $connection = @mysql_connect('localhost', 'darosweb_xxx', '1234x') or die (mysql_error());
  2. $db = @mysql_select_db('darosweb_xxx', $connection) or die (mysql_error());
  3.  
  4. $zmienna=mysql_query("SELECT * FROM users WHERE status ") or die (mysql_error());
  5. $sql = mysql_query($zmienna,$connection);
  6.  
  7. while(list($status)=mysql_fetch_row($zmienna)){
  8.  
  9. $lista="<option value='$uid'>$status</option>";
  10.  
  11.  
  12. <tr bgcolor=#cccccc>
  13. </tr>
  14. <tr>
  15. <td>Pizza</td>
  16.  
  17. <td align="left"><input type="text" name="ilosc" size="5" maxlength="5" /></td>
  18.  
  19. </td>
  20. <td>
  21. <select name="status">$lista</select>
  22. </td>
  23.  
  24.  
  25.  
Go to the top of the page
+Quote Post
Ghost_78
post
Post #2





Grupa: Zarejestrowani
Postów: 222
Pomógł: 34
Dołączył: 3.11.2010

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


to jest chyba nie potrzebne
  1. $sql = mysql_query($zmienna,$connection);

zobacz tak:
  1. $connection = @mysql_connect('localhost', 'darosweb_xxx', '1234x') or die (mysql_error());
  2. $db = @mysql_select_db('darosweb_xxx', $connection) or die (mysql_error());
  3. $zmienna=mysql_query("SELECT * FROM users WHERE status ") or die (mysql_error());
  4. while(list($status)=mysql_fetch_row($zmienna)){
  5. $lista="<option value='$uid'>$status</option>";
  6. <tr bgcolor=#cccccc>
  7. </tr>
  8. <tr>
  9. <td>Pizza</td>
  10.  
  11. <td align="left"><input type="text" name="ilosc" size="5" maxlength="5" /></td>
  12.  
  13. </td>
  14. <td>
  15. <select name="status">$lista</select>
  16. </td>
  17.  


Ten post edytował Ghost_78 10.11.2010, 14:19:47


--------------------
Always look on the bright side of life ;-)
Go to the top of the page
+Quote Post
daros17
post
Post #3





Grupa: Zarejestrowani
Postów: 233
Pomógł: 27
Dołączył: 27.08.2007

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


Zrobiłem tak i wówczas nic nie pokazuje
Go to the top of the page
+Quote Post
Soulast
post
Post #4





Grupa: Zarejestrowani
Postów: 133
Pomógł: 6
Dołączył: 26.10.2009

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


Tu w Twoim ostatnim poście znajdziesz odpowiedź

Temat: HTMLPHPFormularz
Go to the top of the page
+Quote Post
CuteOne
post
Post #5





Grupa: Zarejestrowani
Postów: 2 958
Pomógł: 574
Dołączył: 23.09.2008
Skąd: wiesz, że tu jestem?

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


  1. <?php
  2. $connection = @mysql_connect('localhost', 'darosweb_xxx', '1234x') or die (mysql_error());
  3. $db = @mysql_select_db('darosweb_xxx', $connection) or die (mysql_error());
  4. $zmienna=mysql_query("SELECT * FROM users WHERE status ") or die (mysql_error());
  5.  
  6. // po co te kombinacje z list() o.O
  7. while(list($uid, $status)=mysql_fetch_row($zmienna)){
  8. $lista .="<option value='$uid'>$status</option>";
  9. }
  10. ?>
  11. <tr bgcolor=#cccccc>
  12. </tr>
  13. <tr>
  14. <td>Pizza</td>
  15.  
  16. <td align="left"><input type="text" name="ilosc" size="5" maxlength="5" /></td>
  17.  
  18. </td>
  19. <td>
  20. <select name="status"><?php echo $lista; ?></select>
  21. </td>
Go to the top of the page
+Quote Post

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: 20.08.2025 - 11:41