Проблем с phpbb2

Проблеми, въпроси, модове и темплейти.
Post Reply
shtdnbg
Нов
Нов
Posts: 1
Joined: Thu Nov 15, 2012 7:29 pm

Проблем с phpbb2

Post by shtdnbg » Thu Nov 15, 2012 7:41 pm

излиза ми следната грешка : Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/hosting/хххх/web/last.php on line 7

Image

Ползвам следния скрипт :

Code: Select all

 <?php

$connection = mysql_connect&#40;"хххх", "хххх", "ххххх"&#41;;
$db = mysql_select_db&#40;"хххх", $connection&#41;;

$query = mysql_query&#40;"select * from phpbb_topics order by topic_last_post_id desc limit 0,5"&#41;;
while&#40;$rows = mysql_fetch_array&#40;$query&#41;&#41;
&#123;
$forum = $rwz&#91;forum_name&#93;;
$catid = $rwz&#91;cat_id&#93;;
$qry2 = mysql_query&#40;"select * from phpbb_categories where cat_id='$catid'"&#41;;
$rwz2 = mysql_fetch_array&#40;$qry2&#41;;
$cat = $rwz2&#91;cat_title&#93;;
if &#40;strlen&#40;$rows&#91;topic_title&#93;&#41;>1&#41;&#123;
printf&#40;"<li><a href=\"../forum/viewtopic.php?t=%d\">%s %s &#91;%d&#93; </a></li>", $rows&#91;topic_id&#93;, $cat, &#40;&#40;strlen&#40;$rows&#91;topic_title&#93;&#41;>35&#41;?substr&#40;$rows&#91;topic_title&#93;,0,35&#41;."..."&#58; $rows&#91;topic_title&#93;&#41;, $rows&#91;topic_replies&#93;&#41;; 
&#125;
&#125;

?>
П.П: това е стар сайт, който качих наново със всичките му SQL-и ,само форума му е преинсталиран понеже бях затрил базата .. Моля помощ :( от 3 часа се боря с тази глупост и незнам как да реша проблема.
Благодаря предварително !

User avatar
eddyy93
Потребител
Потребител
Posts: 1421
Joined: Mon Jun 06, 2011 10:32 am

п

Post by eddyy93 » Thu Nov 15, 2012 9:35 pm

Сложи mysql_error(); да видим грешката:

[php]
$connection = mysql_connect("хххх", "хххх", "ххххх") or die(mysql_error());
$db = mysql_select_db("хххх", $connection) or die(mysql_error());

$query = mysql_query("select * from phpbb_topics order by topic_last_post_id desc limit 0,5") or die(mysql_error());
[/php]

Post Reply