Current location: Hot Scripts Forums » Programming Languages » PHP » Is this possible? display all years between two selected


Is this possible? display all years between two selected

Reply
  #1 (permalink)  
Old 10-05-04, 03:24 PM
APuppyDog APuppyDog is offline
Newbie Coder
 
Join Date: Jul 2003
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Is this possible? display all years between two selected

I have a script which adds to a database such as from, and to.

let's say I was in the marines from 1980 to 1990, when I enter it in the databse, i enter from 1980, to 1990

Then, I want a page to be able to search. But on this page, i just want one drop down with all the years from the database.. so in my database, i have a from_year, and a to_year colum in a table

is it possible to display a drop down with all the values from from_year, to to_year like this

1980
1981
...
...
...
2003
2004
Reply With Quote
  #2 (permalink)  
Old 10-05-04, 09:51 PM
Eclipse's Avatar
Eclipse Eclipse is offline
Coding Addict
 
Join Date: May 2004
Location: Long Island, New York
Posts: 356
Thanks: 0
Thanked 0 Times in 0 Posts
Yea try this well this is the general idea
PHP Code:

$year1 $_POST["year1"]; //lets says it's 2000

$year2 $_POST["year2"]; //lets say it's 2004
$test $year1;
while(
$test != $year2){
echo(
$test);
$test = ++$test;

Then use a js function to make sure that the first one is larger than the second. Hope that helps...
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Image display based on URL rjwebgraphix PHP 5 09-09-04 08:02 AM
PHP/MySQL programmer for hire (2+ Years of exp) Sykoi Job Offers & Assistance 0 06-29-04 12:54 PM
display selected value in drop down list angela JavaScript 1 04-02-04 08:43 AM
index page not showing up skipper23 PHP 3 12-15-03 01:10 PM
call, array and display? irfaan PHP 5 08-09-03 05:41 PM


All times are GMT -5. The time now is 04:34 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.