Jump to content


Photo

PHP Versions


  • Please log in to reply
15 replies to this topic

#1 stb74

stb74
  • Members
  • PipPipPip
  • Advanced Member
  • 71 posts
  • LocationNorthern Ireland

Posted 19 October 2006 - 11:40 AM

Is there any difference in version 4.4.2 and 4.4.2-pl

I am running a site with a soccer stats script and use xampp on my own PC to do the coding and then upload to the server.  I had recenlty made a few additions to the code which works fine with my local server but when I upload it to the live system it doesn't work.

The only differences in software between local and server as far as I can see it the -pl on the php.

Anyone any ideas!!

Thanks

nifootball.co.uk

#2 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 19 October 2006 - 11:42 AM

Sure there is a difference else they wouldn't have released a new version.

PHP 4 Changelog

Edit: -pl mean it is some sort of pre-release or non-finished version. It is after RC and just before final.

#3 stb74

stb74
  • Members
  • PipPipPip
  • Advanced Member
  • 71 posts
  • LocationNorthern Ireland

Posted 19 October 2006 - 12:49 PM

xampp uses php 4.4.2-pl and it works with the code that I have written.

I am trying to get the version that is on the server 4.4.2 working with xampp so I can try and figure out what is broke. 

It would be better for me if I could get the server version upgraded, but thats not going to happen.


nifootball.co.uk

#4 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 19 October 2006 - 12:51 PM

So you say that your code that is written in an enviroment using 4.4.2-pl does not work on a server that uses 4.4.2?

#5 stb74

stb74
  • Members
  • PipPipPip
  • Advanced Member
  • 71 posts
  • LocationNorthern Ireland

Posted 19 October 2006 - 01:07 PM

Yes


nifootball.co.uk

#6 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 19 October 2006 - 01:11 PM

What errors do you get? Maybe we can find alternative solutions.

#7 stb74

stb74
  • Members
  • PipPipPip
  • Advanced Member
  • 71 posts
  • LocationNorthern Ireland

Posted 19 October 2006 - 01:35 PM

I was trying to break my local version so I could figure out what the issue was, there is no point in me trying to develop apps that when I upload working copies to the server that they break.

I have spoken to the hosting company and they aren't prepared to upgrade, which is understandable.


If you go here and change a division you will be able to see the error.

http://www.nifootbal...apper&Itemid=65
nifootball.co.uk

#8 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 19 October 2006 - 01:38 PM

You need to show me the actual error. Paste it here.

I have spoken to the hosting company and they aren't prepared to upgrade, which is understandable.

It would be downgrading since 4.4.2 is a more recent version than 4.4.2-pl. Instead you should consider upgrading to 4.4.2 or the most recent 4.4.4.

#9 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 19 October 2006 - 01:39 PM

I changed division twice and dont see any error. How about you make it simple and tell us what it is?

#10 stb74

stb74
  • Members
  • PipPipPip
  • Advanced Member
  • 71 posts
  • LocationNorthern Ireland

Posted 19 October 2006 - 01:48 PM

You need to show me the actual error. Paste it here.

I have spoken to the hosting company and they aren't prepared to upgrade, which is understandable.

It would be downgrading since 4.4.2 is a more recent version than 4.4.2-pl. Instead you should consider upgrading to 4.4.2 or the most recent 4.4.4.


Sorry thats what I meant, it also works fin with the latest version of php 5
nifootball.co.uk

#11 stb74

stb74
  • Members
  • PipPipPip
  • Advanced Member
  • 71 posts
  • LocationNorthern Ireland

Posted 19 October 2006 - 01:51 PM

Looks like its doing something completet different now  :'(

Where the matches are if you change to a different team you should see the error.

But this is what it says.

Warning: array_multisort(): Argument #21 is expected to be an array or a sort flag in /home/nifootball/domains/nifootball.co.uk/public_html/leagues/amateurleague/includes/tabledata.php on line 232

If I remove the details that I use to change the teams the table and this code will work fine.
nifootball.co.uk

#12 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 19 October 2006 - 01:55 PM

You need to post some relevent code.

#13 stb74

stb74
  • Members
  • PipPipPip
  • Advanced Member
  • 71 posts
  • LocationNorthern Ireland

Posted 19 October 2006 - 01:57 PM

thorpe

My apologies for looking to get prompted as I have tried to get help in other forums and in some I have put too much information and other I haven't put enough.

There is a lot of code in this should I post it all.

Thanks
Scott
nifootball.co.uk

#14 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 19 October 2006 - 02:00 PM

There is a lot of code in this should I post it all.


No, post relevent code.

#15 stb74

stb74
  • Members
  • PipPipPip
  • Advanced Member
  • 71 posts
  • LocationNorthern Ireland

Posted 19 October 2006 - 02:04 PM


<?php
		include('../../Connections/nifootball_stats.php');
		include ('includes/prefs.php');
		include ('includes/lastupdated.php');
		include ('includes/leaguedata.php');
		// Start Loop and read teams in to Table.
		$i = 0;
		do
		{
			$team[$i] = $row_get_teams['name'];
			$teamid[$i] = $row_get_teams['id'];
			//$teamstatus[$i] = $row_get_teams['status'];
			
			// Get Home Wins
			mysql_select_db($database_nifootball_stats, $nifootball_stats);
			$query_home_wins = "SELECT COUNT(DISTINCT LM.matchID) AS homewins
			FROM nafl_matches LM
			WHERE LM.matchHomeWin = '$teamid[$i]'
			AND LM.matchSeasonID LIKE '$defaultseasonid'
			AND LM.matchDivisionID LIKE '$defaultdivisionid' ";
			$home_wins = mysql_query($query_home_wins, $nifootball_stats) or die(mysql_error());
			$row_home_wins = mysql_fetch_assoc($home_wins);
			$totalRows_home_wins = mysql_num_rows($home_wins);

			//Home wins into the table
			$homewins[$i] = $row_home_wins['homewins'];

			mysql_free_result($home_wins);

			// Get Away Wins
			mysql_select_db($database_nifootball_stats, $nifootball_stats);
			$query_away_wins = "SELECT COUNT(DISTINCT LM.matchID) AS awaywins
			FROM nafl_matches LM
			WHERE LM.matchAwayWin = '$teamid[$i]'
			AND LM.matchSeasonID LIKE '$defaultseasonid'
			AND LM.matchDivisionID LIKE '$defaultdivisionid' ";
			$away_wins = mysql_query($query_away_wins, $nifootball_stats) or die(mysql_error());
			$row_away_wins = mysql_fetch_assoc($away_wins);
			$totalRows_away_wins = mysql_num_rows($away_wins);

			$awaywins[$i] = $row_away_wins['awaywins'];

			mysql_free_result($away_wins);

			// Get Home Draws
			mysql_select_db($database_nifootball_stats, $nifootball_stats);
			$query_home_draws = "SELECT COUNT(DISTINCT LM.matchID) AS homedraws
			FROM nafl_matches LM
			WHERE LM.matchHomeDraw = '$teamid[$i]'
			AND LM.matchSeasonID LIKE '$defaultseasonid'
			AND LM.matchDivisionID LIKE '$defaultdivisionid' ";
			$home_draws = mysql_query($query_home_draws, $nifootball_stats) or die(mysql_error());
			$row_home_draws = mysql_fetch_assoc($home_draws);
			$totalRows_home_draws = mysql_num_rows($home_draws);

			//Home draws into the table
			//$row_home_draws = mysql_fetch_assoc($home_draws);
			$homedraws[$i] = $row_home_draws['homedraws'];

			mysql_free_result($home_draws);

			// Get Away Draws
			mysql_select_db($database_nifootball_stats, $nifootball_stats);
			$query_away_draws = "SELECT COUNT(DISTINCT LM.matchID) AS awaydraws
			FROM nafl_matches LM
			WHERE LM.matchAwayDraw = '$teamid[$i]'
			AND LM.matchSeasonID LIKE '$defaultseasonid'
			AND LM.matchDivisionID LIKE '$defaultdivisionid' ";
			$away_draws = mysql_query($query_away_draws, $nifootball_stats) or die(mysql_error());
			$row_away_draws = mysql_fetch_assoc($away_draws);
			$totalRows_away_draws = mysql_num_rows($away_draws);

			$awaydraws[$i] = $row_away_draws['awaydraws'];

			mysql_free_result($away_draws);

			// Get Home Loses
			mysql_select_db($database_nifootball_stats, $nifootball_stats);
			$query_home_loses = "SELECT COUNT(DISTINCT LM.matchID) AS homeloses
			FROM nafl_matches LM
			WHERE LM.matchHomeLose = '$teamid[$i]'
			AND LM.matchSeasonID LIKE '$defaultseasonid'
			AND LM.matchDivisionID LIKE '$defaultdivisionid' ";
			$home_loses = mysql_query($query_home_loses, $nifootball_stats) or die(mysql_error());
			$row_home_loses = mysql_fetch_assoc($home_loses);
			$totalRows_home_loses = mysql_num_rows($home_loses);

			//Home loses into the table
			$homeloses[$i] = $row_home_loses['homeloses'];

			mysql_free_result($home_loses);

			// Get Away Loses.
			mysql_select_db($database_nifootball_stats, $nifootball_stats);
			$query_away_loses = "SELECT COUNT(DISTINCT LM.matchID) AS awayloses
			FROM nafl_matches LM
			WHERE LM.matchAwayLose = '$teamid[$i]'
			AND LM.matchSeasonID LIKE '$defaultseasonid'
			AND LM.matchDivisionID LIKE '$defaultdivisionid' ";
			$away_loses = mysql_query($query_away_loses, $nifootball_stats) or die(mysql_error());
			$row_away_loses = mysql_fetch_assoc($away_loses);
			$totalRows_away_loses = mysql_num_rows($away_loses);

			$awayloses[$i] = $row_away_loses['awayloses'];

			mysql_free_result($away_loses);

			// Get Home Goals For.
			mysql_select_db($database_nifootball_stats, $nifootball_stats);
			$query_home_goals = "SELECT SUM( LM.matchHomeGoals) AS homegoals
			FROM nafl_matches LM
			WHERE LM.matchHomeID = '$teamid[$i]'
			AND	LM.matchSeasonID LIKE '$defaultseasonid'
			AND	LM.matchDivisionID LIKE '$defaultdivisionid'";
			$home_goals = mysql_query($query_home_goals, $nifootball_stats) or die(mysql_error());
			$row_home_goals = mysql_fetch_assoc($home_goals);
			$totalRows_home_goals = mysql_num_rows($home_goals);

			if(is_null($row_home_goals['homegoals']))
				$homegoals[$i] = 0;
			else
				$homegoals[$i] = $row_home_goals['homegoals'];

			mysql_free_result($home_goals);

			// Get Away Goals For.
			mysql_select_db($database_nifootball_stats, $nifootball_stats);
			$query_away_goals = "SELECT SUM( LM.matchAwayGoals) AS awaygoals
			FROM nafl_matches LM
			WHERE LM.matchAwayID = '$teamid[$i]'
			AND	LM.matchSeasonID LIKE '$defaultseasonid'
			AND	LM.matchDivisionID LIKE '$defaultdivisionid'";
			$away_goals = mysql_query($query_away_goals, $nifootball_stats) or die(mysql_error());
			$row_away_goals = mysql_fetch_assoc($away_goals);
			$totalRows_away_goals = mysql_num_rows($away_goals);

			if(is_null($row_away_goals['awaygoals']))
				$awaygoals[$i] = 0;
			else
				$awaygoals[$i] = $row_away_goals['awaygoals'];

			mysql_free_result($away_goals);

			// Get Home Goals Against.
			mysql_select_db($database_nifootball_stats, $nifootball_stats);
			$query_home_goals_against = "SELECT SUM( LM.matchAwayGoals) AS homegoalsagainst
			FROM nafl_matches LM
			WHERE LM.matchHomeID = '$teamid[$i]'
			AND	LM.matchSeasonID LIKE '$defaultseasonid'
			AND LM.matchDivisionID LIKE '$defaultdivisionid'";
			$home_goals_against = mysql_query($query_home_goals_against, $nifootball_stats) or die(mysql_error());
			$row_home_goals_against = mysql_fetch_assoc($home_goals_against);
			$totalRows_home_goals_against = mysql_num_rows($home_goals_against);

			if(is_null($row_home_goals_against['homegoalsagainst']))
				$homegoalsagainst[$i] = 0;
			else
				$homegoalsagainst[$i] = $row_home_goals_against['homegoalsagainst'];

			mysql_free_result($home_goals_against);

			//Away Goals Against.
			mysql_select_db($database_nifootball_stats, $nifootball_stats);
			$query_away_goals_against = "SELECT SUM( LM.matchHomeGoals) AS awaygoalsagainst
			FROM nafl_matches LM
			WHERE LM.matchAwayID = '$teamid[$i]'
			AND	LM.matchSeasonID LIKE '$defaultseasonid'
			AND	LM.matchDivisionID LIKE '$defaultdivisionid'";
			$away_goals_against = mysql_query($query_away_goals_against, $nifootball_stats) or die(mysql_error());
			$row_away_goals_against = mysql_fetch_assoc($away_goals_against);
			$totalRows_away_goals_against = mysql_num_rows($away_goals_against);

			if(is_null($row_away_goals_against['awaygoalsagainst']))
				$awaygoalsagainst[$i] = 0;
			else
				$awaygoalsagainst[$i] = $row_away_goals_against['awaygoalsagainst'];

			mysql_free_result($away_goals_against);

			//
			//Calculates points and matches
			//

			$wins[$i] = ($homewins[$i]+$awaywins[$i]);
			$draws[$i] = ($homedraws[$i]+$awaydraws[$i]);
			$loses[$i] = ($homeloses[$i]+$awayloses[$i]);
			$goals_for[$i] = ($homegoals[$i] + $awaygoals[$i]);
			$goals_against[$i] = ($homegoalsagainst[$i] + $awaygoalsagainst[$i]);

			//
			//Lets make change in points if there are data in nafl_deductedpoints-table
			//
			
			mysql_select_db($database_nifootball_stats, $nifootball_stats);
			$query_get_deductions = "
			SELECT points FROM nafl_deductedpoints 
			WHERE seasonid LIKE '$defaultseasonid' 
			AND	teamid = '$teamid[$i]' LIMIT 1";
			$get_deductions = mysql_query($query_get_deductions, $nifootball_stats) or die(mysql_error());
			$row_get_deductions = mysql_fetch_assoc($get_deductions);
			$totalRows_get_deductions = mysql_num_rows($get_deductions);

			$temp_points = 0;
		
			if( mysql_num_rows($get_deductions) > 0)
			{
				do 
				{
					$temp_points = $temp_points + $row_get_deductions['points'];
				} while($row_get_deductions = mysql_fetch_assoc($get_deductions)) ;
				 
			}

			mysql_free_result($get_deductions);
								
			
			$points[$i] = $temp_points + (($homewins[$i]+$awaywins[$i])*$for_win) + (($homedraws[$i]+$awaydraws[$i])*$for_draw) + (($homeloses[$i]+$awayloses[$i])*$for_lose);
			$pld[$i] = $homewins[$i]+$homedraws[$i]+$homeloses[$i]+$awaywins[$i]+$awaydraws[$i]+$awayloses[$i];
				
				//
				//Calculates goal difference
				//
				$diff[$i] = ($homegoals[$i] + $awaygoals[$i]) - ($homegoalsagainst[$i] + $awaygoalsagainst[$i]);

			$i++;
		} while($row_get_teams = mysql_fetch_assoc($get_teams)); // End Loop and read teams in to Table.

		$qty = $totalRows_get_teams;
	

		// Sort By Points
		array_multisort($points, SORT_DESC, SORT_NUMERIC, $diff, SORT_DESC, SORT_NUMERIC, $goals_for, SORT_DESC, SORT_NUMERIC, $wins, SORT_DESC, SORT_NUMERIC, $goals_against, SORT_ASC, SORT_NUMERIC, $draws, $loses, $pld, SORT_DESC, SORT_NUMERIC, $team, $homewins, $homedraws, $homeloses, $awaywins, $awaydraws, $awayloses, $homegoals, $homegoalsagainst, $awaygoals, $awaygoalsagainst);

?>

nifootball.co.uk

#16 stb74

stb74
  • Members
  • PipPipPip
  • Advanced Member
  • 71 posts
  • LocationNorthern Ireland

Posted 19 October 2006 - 02:28 PM

guys

While I'm not sure what I am doing I do think that the problem is with the forms.

In the index.php which displays the league table I have a form that you change the season and division.

Then within the matches.php I have another form that you use to change the teams matches.  If I take this code out then the league table will display ok.

Here is the index.php form

echo "<form method=\"post\" action=\"\">";
echo '<table width="100%" border="1" cellspacing="1" cellpadding="5" bgcolor="CCCCCC">';
  echo '<tr>';
    echo '<td>';

	echo "Season: ";
	echo '<select name="season">';
	
	do
	{
		if ($row_seasons['seasonID'] == $defaultseasonid)
		{
			echo "<option value=\"$row_seasons[seasonID]\" SELECTED>$row_seasons[seasonName]</option>\n";
		}
		else
			echo "<option value=\"$row_seasons[seasonID]\">$row_seasons[seasonName]</option>\n";
	} while($row_seasons = mysql_fetch_assoc($seasons));

	mysql_free_result($seasons);

		echo '</select>';
		echo "<input type=\"submit\" value=\"Go\" name=\"submit_season\">";
		echo '</td>';

		echo '<td align="right">';
		echo "Division: ";
		echo '<select name="division">';

		do
	{
		if ($row_divisions['divisionID'] == $defaultdivisionid)
		{
			echo "<option value=\"$row_divisions[divisionID]\" SELECTED>$row_divisions[divisionName]</option>\n";
		}
		else
			echo "<option value=\"$row_divisions[divisionID]\">$row_divisions[divisionName]</option>\n";
	} while($row_divisions = mysql_fetch_assoc($divisions));

	mysql_free_result($divisions);

		echo '</select>';
		echo "<input type=\"submit\" value=\"Go\" name=\"submit_division\">";
		echo '</td>';
	echo '</tr>';
echo '</table>';
echo '</form>';


Here is the matches.php form

echo "<form method=\"post\" action=\"\">";

		echo '<table width="100%" cellspacing="1" cellpadding="5" bgcolor="CCCCCC">'; 
			echo '<tr>';
			echo '<td align="right" valign="top" class="matchhead">';
			echo "Matches: ";
			echo '<select name="team">';
			echo '<option value="0">All Matches</option>';
			do
			{
				echo "<option value=\"$row_team_matches[teamID]\">$row_team_matches[teamName]</option>\n";
			} while($row_team_matches = mysql_fetch_assoc($team_matches));
		
			mysql_free_result($team_matches);
		
				echo '</select>';
				echo "<input type=\"submit\" value=\"Go\" name=\"submit_team\">";

			echo '</td>';
			echo '</tr>';
			echo '</table>';	
			echo '</form>';

nifootball.co.uk




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users