Jump to content

Called value functions different from calling values


Paul-D

Recommended Posts

Hi I call a function with values of 51 and 100 but the function receives values 1 and 50

 

<?php
// EmilyMoor Version 1.0.0   05-07-2019   Desmond O'Toole.
ini_set('display_errors', 1);
error_reporting(E_ALL);
require("../secure/SecureFunctions.php");
require("secure/SecureFunctionsEmilyMoor.php");
$page = "Emily Moor";
session_start();

$Browser = $_SERVER['HTTP_USER_AGENT'];

if (!isset($_SESSION["PageValue"]))
    $_SESSION["PageValue"] = '1';

$_SESSION["PageValue"] = 2; // Keeps going back to 1

if($_SESSION["PageValue"] == 1)
{
	$_SESSION["StartValue"] = 1;
	$_SESSION["EndValue"] = 50;
}

if($_SESSION["PageValue"] == 2)
{
	$_SESSION["StartValue"] = 51;
	$_SESSION["EndValue"] = 100;
}

if($_SESSION["PageValue"] == 3)
{
	$_SESSION["StartValue"] = 101;
	$_SESSION["EndValue"] = 150;
}

if($_SESSION["PageValue"] == 4)
{
	$_SESSION["StartValue"] = 151;
	$_SESSION["EndValue"] = 200;
}

if($_SESSION["PageValue"] == 5)
{
	$_SESSION["StartValue"] = 201;
	$_SESSION["EndValue"] = 250;
}

if($_SESSION["PageValue"] == 6)
{
	$_SESSION["StartValue"] = 251;
	$_SESSION["EndValue"] = 300;
}

echo $_SESSION["PageValue"] . " - " . $_SESSION["StartValue"] . " - " . $_SESSION["EndValue"] . "<br>";

$qStationDetails = GetChanelInfo($_SESSION["StartValue"],$_SESSION["EndValue"]);
$rs = mysql_fetch_array($qStationDetails) or die ("E3001-101A");
$Name = $rs['Description'];


?>
function GetChanelInfo($StartCH, $EndCH) // E2004
{
	echo "Channels = " . $StartCH . " " . $EndCH . "<br>"; // values are 1 and 50
	$sqlChanelInfo = "SELECT * FROM  TV_EmilyMoor WHERE ID >= $StartCH and ID <= $EndCH";
	echo $sqlChanelInfo . "<br />";
	$qChanelInfo = mysql_query($sqlChanelInfo) or die ("E3004-01A");
	return $qChanelInfo;
}

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.