try this
change
PHP Code:
$res=mysql_query("SELECT id, name, info_hash,announce FROM torrents WHERE updated = '0' ORDER BY id DESC LIMIT 5");
while ($row=mysql_fetch_assoc($res)) {//do the scrape
to
PHP Code:
$query_string = "SELECT id, name, info_hash, announce FROM torrents WHERE updated = '0' ORDER BY id DESC LIMIT 5";
$query = mysql_query($query_string) or die(mysql_error());
while ($row = mysql_fetch_assoc($query)) {//do the scrape