Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to build checkbox array


Colin

Recommended Posts

hey guys,

I have a sample page, the location is: http://www.colinopseth.com/search/years.php

 

To add years to a database I have a separate page. This will allow easier addition of years at a later date. Basically, it's an 'add' page only where you can insert one year per insertion.

 

This years.php page, I want to build it from the values that are in the years table. Each year is stored in the table years with the fields being year_id and year. Year id is a field with a maximum of 4 numbers (there'll never be more than 9999 model year ids) and the year field has the same to allow a maximum of 9999 years.

 

A sample year would be 1950 with a year_id of 1 and year of 1950.

 

How can I take say, those two years (year_id=1, year=1950) and (year_id=2, year=1951) and build the years.php page with it? I need this dynamic so that it can automatically change to include new years each time one is added on the add page..

 

I'm confused.. I can build the checkboxes with the tep_draw_checkbox() but I don't know how to build all of the checkboxes with values from the database. That page is currently hardcoded..

 

thanks!

Colin

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...