Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP] Dwa Wyrażenia mysql_fetch_array
oomaster
post 13.01.2012, 21:04:07
Post #1





Grupa: Zarejestrowani
Postów: 305
Pomógł: 3
Dołączył: 4.08.2006
Skąd: GDA

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


Witam,

Mam problem związany z poniższym kodem.

  1. $web = mysql_query("SELECT * FROM oferta WHERE status='5' ORDER BY kolej ");
  2. echo '<style type="text/css">';
  3. while( $webo = mysql_fetch_array($web)) {
  4. echo 'div.box_ofer_'.$webo['id'].' {width:318px; border: #e3e3e3 1px solid; background: url(gfx/of_'.$webo['id'].'.gif) no-repeat; padding:5px; color: #4a4a4a; float:left;} ';
  5. }
  6. echo '</style>';
  7. $ilosc = mysql_num_rows($web);
  8. echo $ilosc;
  9.  
  10. while( $web2 = mysql_fetch_array($web)) {
  11. for($i = 0; $i < $ilosc; $i++){
  12. if($i % 2 == 0){
  13. echo '<div class="box_ofer_'.$web2['id'].'"><p class="call_title">'.$web2['name'].'</p><br/><br/>
  14. <img src="gfx/r.gif" class="ic"> '.$web2['ul1'].'<br/>
  15. <img src="gfx/r.gif" class="ic"> '.$web2['ul2'].'<br/>
  16. <div class="czysc"></div><br/><a href="oferta.php?ID='.$web2['id'].'" class="more">poznaj szczegóły ť</a></div><div class="ofer_sp">&nbsp;</div>';
  17. }else{
  18. echo '<div class="box_ofer_'.$web2['id'].'"><p class="call_title">'.$web2['name'].'</p><br/><br/>
  19. <img src="gfx/r.gif" class="ic"> '.$web2['ul1'].'<br/>
  20. <img src="gfx/r.gif" class="ic"> '.$web2['ul2'].'<br/>
  21. <div class="czysc"></div><br/><a href="oferta.php?ID='.$web2['id'].'" class="more">poznaj szczegóły ť</a></div><div class="czysc"></div><br/>';
  22. }
  23. }
  24. }


Otóż zawsze to drugie mysql_fetch_array nic nie pobiera. Robie różne kombinacje i zawsze drugie array nie działa. Dlaczego ? Jak to naprawić i uzdrowić ?
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 Wersja Lo-Fi Aktualny czas: 14.08.2025 - 13:14