note 16089 deleted from function.echo by jimw
| From: | jimw@php.net | Date: | Tue, 16 Oct 2001 17:21:02 +0000 |
| Subject: | note 16089 deleted from function.echo by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-18995@lists.php.net to get a copy of this message | ||
PHP & MySQL : Placing a Range Maker for submitting to another page ( Part 2 ).
===================================================================
Created : Séan J. Lathey
Date : 16/10/2001
© Copyright 2001
*******************************************************************************
* Place this in the COMMON file or the receiving page *
*******************************************************************************
function getRange( $keyword )
{
$getRange = explode ("-", $keyword);
return $getRange;
}
*******************************************************************************
* Place this in the receiving page *
*******************************************************************************
// Alter the HEADER accordingly, like this one perhaps
commonHeader2("Serial Numbers Register : « Show records for $NumRange
».");
// This finds the start and end ranges from the pass value for $NumRange
$TheNumbers=getRange($NumRange);
$StartRange=$TheNumbers[0];
$EndRange=$TheNumbers[1];
// Add this to the MySQL SELECT statement
$q.="WHERE";
if($NumRange=="ALL")
{
$q.=" $UseTable.$UseField > $BaseNum ";
}
else
{
$q.=" $UseTable.$UseField >= $StartRange ";
$q.="AND";
$q.=" $UseTable.$UseField <= $EndRange ";
}
// If allowing to change the order on the receiving page, then add to the form action statement
&NumRange=$NumRange&UseTable=$UseTable&UseField=$UseField&BaseNum=$BaseNum