adzie Posted February 25, 2008 Share Posted February 25, 2008 Hi people, I have a small dilema i hope you can provide some advice or tips to try and resolve I have two servers (in the process of moving servers) I have copied over the database and scripts. the results the SAME script provides is different on each server, the script it designed to total members online time, each session creates a record of duration online I have manually checked the amount of records and all appears to be normal. Both windows servers. any pointers? thanks Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 25, 2008 Share Posted February 25, 2008 Post your code. Quote Link to comment Share on other sites More sharing options...
revraz Posted February 25, 2008 Share Posted February 25, 2008 Can you manually determine which one is right? Quote Link to comment Share on other sites More sharing options...
adzie Posted February 25, 2008 Author Share Posted February 25, 2008 sorrry about that <?php error_reporting(E_ALL); $hostName = $userName = $password = $dbName = mysql_connect($hostName, $userName, $password) or die("Unable to connect to host $hostName"); mysql_select_db($dbName) or die("Unable to select database $dbName"); $query_hours = "SELECT sec_to_time(sum(time_to_sec(t2.duration))) AS duration_sum FROM members t1, member_time t2 WHERE t1.member_num=t2.mnum"; $result_hours = mysql_query($query_hours); if (mysql_numrows($result_hours) > 0) { $rtime = mysql_result($result_hours,0,"duration_sum"); $htime = substr($rtime,0,5); $time = ($rtime + 7000); } $sql2="select * members"; $query2 = mysql_query($sql2); $member = mysql_numrows($query2); if($member == 0) { $avg = "0"; $time = "0:00:00"; } else { $avg = $time/$member; $avg = substr($avg,0, strpos($avg,".")+3); } ?> Quote Link to comment Share on other sites More sharing options...
vicodin Posted February 25, 2008 Share Posted February 25, 2008 The only thing i can think of is if your using sessions and the max life of the sessions are different on both servers? Quote Link to comment Share on other sites More sharing options...
adzie Posted February 25, 2008 Author Share Posted February 25, 2008 no another script just enters the duration into the database, i've tried this on three servers and its only the new one which shows different results Quote Link to comment Share on other sites More sharing options...
vicodin Posted February 25, 2008 Share Posted February 25, 2008 Different php version on that server? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted February 25, 2008 Share Posted February 25, 2008 You need to do some old fashion debugging. Echo out the values to find which one is not correct, then work back from there to find the problem. With what you have posted so far, we don't know what the results should be and what you are getting when they are not correct. Which means the best you can get are guesses. Post your data with both the correct and incorrect answers. Quote Link to comment Share on other sites More sharing options...
adzie Posted February 25, 2008 Author Share Posted February 25, 2008 its php 4 i just noticed that the script wont display anything over 8 hrs 59 mins Quote Link to comment 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.