последните теми проблем

big_boy

Registered
имам проблем с скрипта за последните теми във форума
ето го скрипта:
Код:
<?php

$host="localhost";
$user="root"; //DB user
$pass="****"; //DB pass
$db="forum2"; //DB name
$broi_temi="20"; // Колко последни теми да показва
$broi_bukvi="35"; //До колко букви от заглавието на темата да показва

mysql_connect(localhost,$user,$pass);
mysql_select_db($db) or die( "Unable to select database");
$query="SELECT c.topic_time , c.topic_title,c.forum_id,c.topic_id, c.topic_replies,c.topic_type,f.forum_name FROM phpbb_topics c, phpbb_forums f WHERE c.forum_id=f.forum_id and f.auth_view like '0' ORDER BY c.topic_time ";
$result=mysql_query($query);
$num=mysql_num_rows($result);
mysql_close();
$ii=$num-$broi_temi;


for ($i=$num-1; $i>$ii;$i--)
{ 
$tema=mysql_result($result,$i,"c.topic_title");
$id=mysql_result($result,$i,"c.forum_id");
$topic_broi=mysql_result($result,$i,"c.topic_replies");
$topic_id=mysql_result($result,$i,"c.topic_id");
$topic=mysql_result($result,$i,"c.topic_type");
$cat=mysql_result($result,$i,"f.forum_name"); 
if($topic=="1")
{$vazna='Важна:';}
elseif($topic=="2")
{$vazna='Съобщение:';}
elseif($topic_status=="1")
{$vazna='<font color#FF0000>Заключена:</font>';}
else
{$vazna='';}

if (strlen($tema)>$broi_bukvi)
{$totchki='...';}
else
{$totchki='';}



$tema=substr($tema,0 , $broi_bukvi);
echo" » $cat: <font color=#FF0000>$vazna</font><a href='Пътя до папката на форума/viewtopic.php?t=$topic_id' >$tema$totchki ($topic_broi)</a><br/>";
}


?>
а ето грешките който ми дава: :(
Код:
Warning: mysql_result() [function.mysql-result]: Unable to jump to row -1 on MySQL result index 3 in D:\pages\xampp\htdocs\forum4e\latest_topics.php on line 21

Warning: mysql_result() [function.mysql-result]: Unable to jump to row -1 on MySQL result index 3 in D:\pages\xampp\htdocs\forum4e\latest_topics.php on line 22

Warning: mysql_result() [function.mysql-result]: Unable to jump to row -1 on MySQL result index 3 in D:\pages\xampp\htdocs\forum4e\latest_topics.php on line 23

Warning: mysql_result() [function.mysql-result]: Unable to jump to row -1 on MySQL result index 3 in D:\pages\xampp\htdocs\forum4e\latest_topics.php on line 24

Warning: mysql_result() [function.mysql-result]: Unable to jump to row -1 on MySQL result index 3 in D:\pages\xampp\htdocs\forum4e\latest_topics.php on line 25

Warning: mysql_result() [function.mysql-result]: Unable to jump to row -1 on MySQL result index 3 in D:\pages\xampp\htdocs\forum4e\latest_topics.php on line 26
Моля ви помогнете ми.
Благодаря предварително
 

Back
Горе