Weird update problem

Discuss phpBB 3.0.x in general.
Forum rules
Please post any phpBB 3.1.x related topics in the phpBB 3.1.x discussion forum.
Post Reply
regdude
New member
New member
Posts: 2
Joined: 22 Jul 2012, 15:44

Weird update problem

Post by regdude »

Hi!
I made a simple page that takes out information from the database and by using phpbb templates it displays as a separate page, only problem is that sometimes it does not update when I change database content.
For example, this I have in my .html file (style):

Code: Select all

<tr class='row2'><td class='profile'><div class='gensmall' style='float: left;'><h2>{CAT_NAME}<h2></div></td></tr>

And in the .php file, which is linked to the .html file, I have this:

Code: Select all

$sql = "SELECT forum_name FROM phpbb_forums WHERE forum_id='85'";
$result = $db->sql_query($sql, 600);
while ($row = $db->sql_fetchrow($result))
{
  $cat_name  = $row['forum_name'];

}
$db->sql_freeresult($result);

$template->assign_vars(array(
    'CAT_NAME' => $cat_name,
));

The problem is that sometimes I change forum_name in ACP, but it does not show the new name in my page, only when I delete cache/.
Is there a way to fix this problem?
Sorry if this isn't the right forum, didn't think that other categories would fit better.
User avatar
tumba25
Supporter
Supporter
Posts: 1058
Joined: 24 Oct 2007, 13:10
Real name: Jari Kanerva
Location: Kokkola, Finland.
Contact:

Re: Weird update problem

Post by tumba25 »

regdude wrote:

Code: Select all

$result = $db->sql_query($sql, 600);

The 600 in that line is the time phpBB will cache that query. If you remove the 600 it will not be cached at all.

Code: Select all

$result = $db->sql_query($sql);
regdude
New member
New member
Posts: 2
Joined: 22 Jul 2012, 15:44

Re: Weird update problem

Post by regdude »

Ohh, wondered why it is there, must have copied that 600 from some kind of an example.
Thanks :)
Post Reply