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.