Witam, mam skrypt rotacji bannerów

_banner.php (wyswietla bannery)

  1. <?
  2. $dbh=mysql_connect (&#092;"localhost\", \"xxx\", \"xxx\") or die ('I cannot connect to the database because: ' . mysql_error());
  3. mysql_select_db (&#092;"xxxxxxx\");
  4. echo(&#092;"<br><center>\");
  5. if(mysql_num_rows(mysql_query(&#092;"select * from banner order by rand() limit 1\"))>0) {
  6. $ran3=mysql_fetch_array(mysql_query(&#092;"select * from banner order by rand() limit 1\"));
  7. $a = mysql_query(&#092;"update banner set view=view+'1' where id='$ran3[id]'\");
  8. echo &#092;"$a\";
  9.  
  10. if ($ran3[view] >= $ran3[rem_vis]){
  11. echo(&#092;"<a href='reklama.html'><img src='zastepczy.gif' height=60 width=468 border=0></a>\");
  12. } else {
  13. echo(&#092;"<a href='show.php?id=$ran3[id]' target='_blank'><img src='$ran3[img]' height=60 width=468 border=0 alt='$ran3[alt]'></a>\");
  14. }
  15. }
  16. else
  17. {
  18.  
  19.   }
  20. echo(&#092;"</center>\");
  21. ?>


  1. <?php
  2. echo(&#092;"<a href='reklama.html'><img src='zastepczy.gif' height=60 width=468 border=0></a>\");
  3. ?>

to jest banner, ktory sie pojawia gdy nie ma zadnych bannerow.

Jednak, gdy dodam 2 bannery to za kazdym odswiezeniem strony (czyli otwarciem powyzszego pliku) dodaja mi sie wyswietlenia, chociaz banner sie nie wyswietlil, bo stracil waznosc. Np. waznosc banneru to 50 wyswietlen gdy mini 50 wysiwetlen to bannr sie nie wyswietla, lecz ciagle mu nalicza wyswietlenia.

Pomocy..
Juz nie wiem gdzie bład...