Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP] wyskoczyly jakies bledy
Forum PHP.pl > Forum > Przedszkole
zenon58
Wyskoczyly dwa bledy o takiej tresci



1 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/kamildu/public_html/ogloszenia24.com.pl/include/banery_ponprom.php on line 5

  1. <?
  2. require_once("admin/wyniki_1.php");
  3. $limit=$_POST['baneryponprom'];
  4. $pobieranie12 = mysql_query ("SELECT * FROM baneryponprom WHERE aktywny = 'T' AND CURDATE()< dataw ORDER BY rand() LIMIT $limit");
  5. while ($zapisz = mysql_fetch_array($pobieranie12)) {
  6.  
  7. $id_banera_inf =$zapisz['id'];
  8. $plik_banera_inf =$zapisz['plik_banera'];
  9. $adres_banera_inf =$zapisz['adres_banera'];
  10. $url_strony_inf =$zapisz['url_strony'];
  11. $width_ban_inf =$zapisz['width_ban'];
  12. $height_ban_inf =$zapisz['height_ban'];
  13.  
  14. $rozszerzenie = strtolower(substr($plik_banera_inf, strrpos($plik_banera_inf, '.') + 1));
  15.  
  16. if($plik_banera_inf) {$addr = "baneryponprom/$plik_banera_inf";}
  17. if($adres_banera_inf) {$addr = "$adres_banera_inf";}
  18.  
  19. $max_width = 700;//default 150
  20. $max_height = 320;//default 300
  21. $width = $width_ban_inf;
  22. $height = $height_ban_inf;
  23. @$x_ratio = $max_width / $width;
  24. @$y_ratio = $max_height / $height;
  25. if(($width <= $max_width) && ($height <= $max_height))
  26. {
  27. $tn_width = $width;
  28. $tn_height = $height;
  29. }
  30. else if(($x_ratio * $height) < $max_height)
  31. {
  32. $tn_height = ceil($x_ratio * $height);
  33. $tn_width = $max_width;
  34. }
  35. else
  36. {
  37. $tn_width = ceil($y_ratio * $width);
  38. $tn_height = $max_height;
  39. }
  40.  
  41. if($rozszerzenie === "swf") {
  42. <object type=\"application/x-shockwave-flash\" data=\"".$addr."\" width=\"".$tn_width."\" height=\"".$tn_height."\">
  43. <param name=\"movie\" value=\"".$addr."\" width=\"".$tn_width."\" height=\"".$tn_height."\">
  44. <param name=\"quality\" value=\"best\"><param name=\"wmode\" value=\"transparent\"></object>
  45. ";
  46. }
  47. else
  48. {
  49. echo "<a href=\"header_baner_top.php?idbaner=1&id_b=".$id_banera_inf."\" target=\"_blank\"><img src=\"".$addr."\" border=\"0\" width=\"".$tn_width."\" height=\"".$tn_height."\" alt=\"Reklama\"></a>";
  50. }
  51. ?>
  52.  
  53. <TABLE height=5 CELLPADDING="0" CELLSPACING="0"><tr><td></td></tr></table>
  54. <?}?>
  55.  








2 Warning: Division by zero in /home/kamildu/public_html/oglo szenia24.com.pl/include/lspons or.php on line 7
  1. <?
  2. $start1 = $_GET['start1'];
  3. $limitlinki=150;
  4. if (!$start1){$start1=0;}
  5. $wynik3 = mysql_query ("SELECT * FROM lsponsorowane WHERE curdate() <= dataw");
  6. $rekordy=mysql_num_rows($wynik3);
  7. $pages=intval($rekordy/$limit);
  8.  
  9. echo"<table width=879 border=0 >
  10. <tr><td class=sponsor2 align=center ><img src=images/strz.gif class=dwukropek2 border=0 /> Linki sponsorowane. </td></tr></table>";
  11. $config = mysql_query ("SELECT * FROM lsponsorowane WHERE curdate() <= dataw limit $start1,$limitlinki");
  12.  
  13. echo"<table width=879 border=0 class=sponsor3 cellpadding=0 cellspacing=0>
  14. <tr><td align=center>";
  15. while ($row = mysql_fetch_array($config))
  16. {
  17. $idr=$row['idr'];
  18. $tytul=$row['tytul'];
  19. $opis2=ucfirst($row['opis']);
  20. $adres=$row['adres'];
  21. $tytul=ucfirst($tytul);
  22.  
  23. $opis=ereg_replace("nbsp; ", " ", $opis2);
  24.  
  25. echo "<a class=a09 href=\"$adres\" target=_blank title=\"$opis\">$tytul</a>&nbsp;";
  26.  
  27. }
  28. echo"</td></tr>";
  29.  
  30.  
  31.  
  32. echo"</table><TABLE height=4 CELLPADDING=0 CELLSPACING=0><tr><td></td></tr></table>";
  33. ?>
  34.  





jak to naprawic ?
CuteOne
1.
  1. if(mysql_num_rows($pobieranie12)) {
  2.  
  3. while ($zapisz = mysql_fetch_array($pobieranie12)) {


2. Nie dzielimy przez zero
  1. $limit = mysql_num_rows($wynik3)
  2. if($limit > 0) {
  3. $pages=intval($rekordy/$limit);
  4. }
  5. else {
  6. $pages = 1;
  7. }

zenon58
wielkie dzieki za pomoc headsetsmiley.png
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.