garydt Posted October 21, 2007 Share Posted October 21, 2007 This is going to be difficult explain..... I have a website and on the main page there is a link to the forum i've made. Click the forum link and the main forum page comes up in a new page showing the discussion topic(s), the author, number of replies and the last post. However, if you view certain pages on the main site and then go back to the main page and click the forum link the forum layout comes up but the discussion topic(s), the author, number of replies and the last post don't come up. I have to close both windows, open my website again, click the forum link again and the discussion topic(s), the author, number of replies and the last post are back again. Weird! Maybe it's just my computer. Could a few people try it, see if the same thing happens? Would be much appreciated. Go to www.elvis-people.com click the forum link. One discussion should be there - Forum guidelines. Now close the forum window. On the main page click on How to view photos. Click on Newest members first or Oldest members first. click go. Then click again on How to view photos, click randomly and click go Click the forum link. Does the discussion topic, replies, etc come up? Quote Link to comment https://forums.phpfreaks.com/topic/74191-a-very-weird-thing/ Share on other sites More sharing options...
garydt Posted October 21, 2007 Author Share Posted October 21, 2007 Has any1 tried it yet? Quote Link to comment https://forums.phpfreaks.com/topic/74191-a-very-weird-thing/#findComment-374796 Share on other sites More sharing options...
garydt Posted October 21, 2007 Author Share Posted October 21, 2007 can anyone help please? Quote Link to comment https://forums.phpfreaks.com/topic/74191-a-very-weird-thing/#findComment-374957 Share on other sites More sharing options...
thebadbad Posted October 21, 2007 Share Posted October 21, 2007 I tried it in both Firefox and IE7, and it happens just like in your case. Very weird indeed. You have to post some code if you want anyone to be able to help though. Quote Link to comment https://forums.phpfreaks.com/topic/74191-a-very-weird-thing/#findComment-374994 Share on other sites More sharing options...
garydt Posted October 22, 2007 Author Share Posted October 22, 2007 Thanks. This is the part of the code on the forum's main page where the problem is occurring. mysql_select_db($database_elvisdb, $elvisdb); $query_Recordset3 = "SELECT * FROM discussions"; $Recordset3 = mysql_query($query_Recordset3, $elvisdb) or die(mysql_error()); $result = mysql_query($query_Recordset3); $t = time(); // loop for putting times of latest posts of each discussion into array. while ($row_Recordset3 = mysql_fetch_assoc($result)) { $row_Recordset3 = mysql_fetch_assoc($Recordset3); $topicnum[$acount] = $row_Recordset3['discnum']; // if discussion is announcement or sticky then increase time so it always stays on top in discussion list if ($row_Recordset3['sticky']=="sticky" or $row_Recordset3['anounc']=="announcement") { if ($row_Recordset3['anounc']=="announcement") { ($t=$t+10); } else { ($t=$t+1); } $oldt = $row_Recordset3['time']; $order[$acount] = $t; $dnam = $topicnum[$acount]; $updateSQL = sprintf("UPDATE discussions SET time='$t' WHERE discnum='$dnam'"); mysql_select_db($database_elvisdb, $elvisdb); $Result1 = mysql_query($updateSQL, $elvisdb) or die(mysql_error()); $updateSQL = sprintf("UPDATE forum SET timenum='$t' WHERE timenum='$oldt'"); mysql_select_db($database_elvisdb, $elvisdb); $Result1 = mysql_query($updateSQL, $elvisdb) or die(mysql_error()); } else { $order[$acount] = $row_Recordset3['time']; } ($acount=$acount+1); $totalRows_Recordset3 = mysql_num_rows($Recordset3); } $total = $totalRows_Recordset3; if ($acount >= 2) { rsort ($order); } print_r ($order); There is only one discussion on the forum at the moment. When the problem occurs what is storred in the 'order' array is this- 1andom What does this mean? Quote Link to comment https://forums.phpfreaks.com/topic/74191-a-very-weird-thing/#findComment-375349 Share on other sites More sharing options...
thebadbad Posted October 22, 2007 Share Posted October 22, 2007 I'm not too familiar with database code, but the "1andom" seems like a typo. Search all your code for "andom" and be sure that it says "random" everywhere i guess. Quote Link to comment https://forums.phpfreaks.com/topic/74191-a-very-weird-thing/#findComment-375352 Share on other sites More sharing options...
garydt Posted October 22, 2007 Author Share Posted October 22, 2007 Thanks. I've searched all code and no 'andom' was found. An Unix timestamp should be stored in the array so why should '1andom' be put in there instead. It should be reading whats stored in the database field and that is an Unix timestamp, so i don't understand it. Quote Link to comment https://forums.phpfreaks.com/topic/74191-a-very-weird-thing/#findComment-375364 Share on other sites More sharing options...
kenrbnsn Posted October 22, 2007 Share Posted October 22, 2007 You need to do more debugging of your scripts. Echo your arrays and variable at critical points. If you are using sessions, make sure you're not reusing the same session variable for more than one meaning. We won't be able to help you without seeing all the relevant code. Ken Quote Link to comment https://forums.phpfreaks.com/topic/74191-a-very-weird-thing/#findComment-375368 Share on other sites More sharing options...
GingerRobot Posted October 22, 2007 Share Posted October 22, 2007 It certainly sounds like a session issue to me. If it ok when you first load the forum, and only have problems after visiting certain other pages, then a session problem seems the most likely. Quote Link to comment https://forums.phpfreaks.com/topic/74191-a-very-weird-thing/#findComment-375378 Share on other sites More sharing options...
garydt Posted October 22, 2007 Author Share Posted October 22, 2007 Thanks. I've got a session variable called order i had forgotten about. Thanks very much. Quote Link to comment https://forums.phpfreaks.com/topic/74191-a-very-weird-thing/#findComment-375390 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.