phpbb fetch all

Problems with forum installation, administration, moderation and other phpBB related support.

Moderator: Moderators

phpbb fetch all

Postby PsychoJim on Fri Nov 24, 2006 5:38 pm

Hi guys im having problems with this mod and wonder if anyone knows how to just fetch topics from one particular forum ( e.g Show off )

i looked through the examples that came with the fetch all but not sure on how to create what i want.

Thanks in advance
Jim

P.S im not really sure how to use phpbb fetch all and looked around for tutorials, if there is a built in deature that is used to make the above please let me know on how its done.
My Site:Gamers Network
Forum:Gamers Network Forum
Gamers Network Teamspeak:213.253.57.56:8768
PsychoJim
Registered User
Registered User
 
Posts: 90
Joined: Wed Nov 16, 2005 10:18 pm
Location: Wales

Re: phpbb fetch all

Postby abidace on Tue Oct 14, 2008 11:19 pm

I have the same problem with phpbb fetchall for phpbb2.
I added a new table to my phpbb database and would like to display the data on the fetch-all portal.

I added a new function in the /mods/phpbb_fetch_all/common.php with the query to select the data from my new table.
Code: Select all
function phpbb_fetch_top_images()
{
   global $userdata, $board_config, $phpbb_root_path;

   $one_front_images = array();

   $sql = "SELECT * FROM `phpbb_portal_image` order by im_date desc";
   $result = MYSQL_QUERY($sql)    or die ("Error in query: $query. ".mysql_error());
   while ($r1 = mysql_fetch_array($result, MYSQL_ASSOC))
   {
      $im_id = $r1["im_id"];
      $im_date = $r1["im_date"];
      $im_image = $r1["im_image"];
      $one_front_images = array();
   }
   mysql_free_result($result);

   return $one_front_images
}


When I call the function from portal,
Code: Select all
$fimagelist = phpbb_fetch_top_images();


I get an access denied error:
Code: Select all
Warning: mysql_query() [function.mysql-query]: Access denied for user 'accmngr'@'localhost' (using password: NO) in /home/accmngr/public_html/forum/mods/phpbb_fetch_all/common.php on line 911

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/accmngr/public_html/forum/mods/phpbb_fetch_all/common.php on line 911
Error in query: . Access denied for user 'accmngr'@'localhost' (using password: NO)


line 911 is:
Code: Select all
$result = MYSQL_QUERY($sql)    or die ("Error in query: $query. ".mysql_error());


Can anyone help explain how to fix this problem?
Thanks.
abidace
Registered User
Registered User
 
Posts: 2
Joined: Thu Sep 18, 2008 9:40 pm

Re: phpbb fetch all

Postby abidace on Tue Oct 14, 2008 11:36 pm

never mind.. It was my mistake.
in the portal, I had placed my call
Code: Select all
$fimagelist = phpbb_fetch_top_images();

after disconnecting from the database...
Code: Select all
// disconnect from the database
phpbb_disconnect();

mindless mindless.. mindless me.

All works fine.
Thanks.
abidace
Registered User
Registered User
 
Posts: 2
Joined: Thu Sep 18, 2008 9:40 pm


Return to phpBB Support

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests

cron