Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php][mysq]Zrzut na tablice z mysql
daniel1302
post
Post #1





Grupa: Zarejestrowani
Postów: 602
Pomógł: 30
Dołączył: 1.08.2007
Skąd: Nowy Sącz

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


Witam chciałbym zrzucić na tablice pole id z tabeli users ale nieumiem prosze o pomoc
  1. <?php
  2. $t = mysql_query("SELECT id FROM users");
  3. while ($a = mysql_fetch_array($t)) {
  4. foreach ($a as $id) {
  5. echo $id.'<br />';
  6. }
  7. }
  8. $arr = array($id);
  9. for ($i=0;$i<27;$i++) {
  10. $arr[$i]
  11. }
  12. ?>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
strife
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 2 605
Pomógł: 96
Dołączył: 22.10.2004
Skąd: UK

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


  1. <?php
  2. // ...
  3. $t = mysql_query("SELECT id FROM users");
  4. $arrID = array();
  5.  
  6. while ($a = mysql_fetch_array($t)) {
  7. $arrID[] = $a['id'];
  8. }
  9.  
  10. echo '<pre>';
  11. var_export($arrID);
  12. // ...
  13. ?>


--------------------
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: 19.08.2025 - 19:31