использую следующий код:
Код |
---|
<table border="0" cellpadding="0" cellspacing="0" width="200">
<tr>
<td colspan=5 height=1><td>
</tr>
<tr>
<td rowspan="11" width="1"></td>
<td width=5 rowspan="11"></td>
<td>
</td>
<td width=5 rowspan="11"></td>
<td rowspan="11" width="1"></td>
</tr>
<?
$host='';
$user='';
$pass='';
$dbname='';
$bb_root='';
$tbl_prefix='phpbb_';
$N=5;
$dbh=mysql_connect($host,$user,$pass);
mysql_select_db($dbname);
$q='';
$i=$N;
while($i){
$sqlc = 'SELECT `post_id`, `poster_id`,`forum_id` FROM `'.$tbl_prefix.'posts` WHERE 1 '.$q.'ORDER BY `post_time` DESC LIMIT 0, 1';
$rc=mysql_query($sqlc);
$rowc=mysql_fetch_row($rc);
$q.='AND `post_id`!='.$rowc[0].' ';
$uid=$rowc[1];
$sql = 'SELECT `topic_id`,`forum_id`,`topic_title`,`topic_poster`,`topic_last_post_id` FROM `'.$tbl_prefix.'topics` WHERE 1 AND `topic_last_post_id`='.$rowc[0];
$r=mysql_query($sql);
$row=mysql_fetch_row($r);
//$sql = 'SELECT `username` FROM `'.$tbl_prefix.'users` WHERE `user_id`='.$rowc[1];
//$unr=mysql_query($sql);
//$username=mysql_fetch_row($unr);
// $sql = 'SELECT `forum_name` FROM `'.$tbl_prefix.'forums` WHERE forum_id='.$rowc[2];
// $fnr=mysql_query($sql);
// $forumname=mysql_fetch_row($fnr);
if((!$row)){ continue; }else{ $i--; }
print "<tr><td style=\" background-color: #EFEFEF\">";
print "";
print "<span style=\"font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; color: #000033; text-decoration: none;\">>> <a href=$bb_root/viewtopic.php?p=$row[4]#$row[4] style=\"text-decoration:underline\">".$row[2]."</a></span><br>";
print "";
if($i>1){
print "</td></tr><tr><td><hr size=1 width=100% color=\"#333333\"></td></tr>";
}else{
print "</td></tr><tr><td height=5></td></tr><tr><td colspan=5 height=1><td></tr>";
}
}
?></table>
|
вставляю его в шаблон сайта. выдается ошибка:
Код |
---|
MySQL Query Error: SELECT VALUE FROM b_user_option WHERE (USER_ID=1 OR COMMON='Y') AND CATEGORY='global' AND NAME='settings' ORDER BY COMMON[Table 'b19616.b_user_option' doesn't exist]
|
что я неправильно делаю?
сам скрипт работает, проверял в отдельно.