Mam skrypt filmów z allegro

i po wklejeniu kody wyświetlania wywala mi błędy
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /srv/www/htdocs/web1/html/pages/list.php on line 23
Nie ma żadnych rekordów w tej kategorii.
kod z list.php
<?php $typ = '`typ` = ' . (int) $_GET['typ']; }else{ $typ = "((`typ` >= 1 and `typ` <= 4) or (typ = '15') or (typ = '16') or (typ = '17'))"; } //$typ = (isset($_GET['typ']) ? '`typ` = ' . (int) $_GET['typ'] : '((`typ` >= 1 and `typ` <= 4) or (typ = '15'))'); $order = ''; if ($_GET['top'] == 1) { $order = ' order by `ocena` desc'; } elseif ($_GET['last'] == 1) { $order = ' order by `added` desc'; } // ilosć trafień $res = mysql_query('select * from `stuff` where ' . $typ . $cat . $order . ' order by added desc limit ' . ((int) $_GET['currentpage'] * 10) . ', ' . ((int) $_GET['currentpage'] * 10 + 10)); if ($hits == 0) { } else { { if($row['added']>0) else $date = (string) ''; $comments_count = (int) 0; if($comments) { $comments_count = $record['CommentsCount']; } if($row['miniaturka']!='') { $image = sprintf('<img src="%s" alt="%s" class="icon" align="right" width="160px" height="120px" border="2" style="border: 1px solid #A20000;"/>', $row['miniaturka'], $row['title']); } else { $image = ''; } else $cat = (string) ''; printf('<table width="461" bgcolor="#F3F3F3" style="margin-bottom:12px; font-family:verdana; font-size:12px;"><tr><td style="text-align:left; clear:both; padding:0 4px;">%s <strong>%s</strong><a href="index.php?page=display&id=%d" class="stufflink" style="font-weight:bold;"><h3>%s</h3></a><br /><br />%s<img src="ikonki/wykres.jpg"> Ocena: %d<br /><img src="ikonki/wykres.gif"> Wyswietlen: %d<br /><img src="ikonki/trabka.gif"> Komentarzy: %d<br /><img src="ikonki/info.gif"> Zasugerował: %s</td></tr></table>', $image, $cat, $row['id'], $row['tytul'], $date, $row['ocena'], $row['counter'], $comments_count, $row['login']); } } /********* NUMEROWANIE *********/ { print("<a href="index.php?page=list¤tpage=" . $i . "&cat=" . $_GET['cat'] . "">" . ($i+1) . "</a>"); if($i == ($temp - 1)) { print("<a href="index.php?page=list¤tpage=" . ($temp - 1) . "&cat=" . $_GET['cat'] . ""></a>"); } } /*******************************/ ?>
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /srv/www/htdocs/web1/html/index.php on line 148
Zarejestrowanych:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /srv/www/htdocs/web1/html/index.php on line 153
z index.php wycinek kodu, błędy są kolejno w 3 i 8 linij.
<p><b>Wszystkich Filmików:<?php ?></p> <p>Zarejestrowanych: <?php ?></p> <p><b>Wszystkich kategori:<?php ?></b></p>
Za pomoc w rozwiązaniu problemu byłbym wdzięczny.