Forum Moderators: coopster
$limit=10;
for($i = $yrFrom; $i <= $yrTo; $i++){
$query = "select distinct * from email where Fyear = $i order by Fname LIMIT $page, $limit";
$result = mysql_query($query);
$num_results = mysql_num_rows($result);
}
Then for example, if year 1940 has 15 records, 1946 has 20 records, 1950 has 22 records and any year between 1940 and 1950 that does not have any records will not show anything. The problem is, the "LIMIT" show 10 records per year and not per page. So therefore, there will be a total of 30 records in one page.
Here's the url to this page I'm testing.
<snip>
Valid years are from 1936 to 1970.
If anyone has an idea, please help me out.
Thanks!
Lauj
[edited by: jatar_k at 6:34 pm (utc) on Feb. 5, 2003]
[edit reason] no urls please [/edit]
what about changing your query to use between [mysql.com] instead of looping the query?
select distinct * from email where Fyear between $yrFrom and $yrTo order by Fname LIMIT $page, $limit