> Each product that is in the database can have at least one attribute to > it (i.e. color, size, etc.). Right now I've got a method in my Products > class called ShowAttributes($id). This method, based on the ID passed to > it, will query the db and ultimately return a string that makes up the > drop down box for a form. > > Am I better off doing this sort of thing in a function or having the > function only return the records I need and let the calling page handle > the display of the records?
I usually allow the function get only what i need, thus making it as simple as i possibly can. If you are using it as a drop down function for a form then i would get the data form a generic source and populate it with that information (i.e. i use arrays that hold data for forms, and query the database to find out which item in the dropdown should be selected. So in short: 1. Have a function return only what you need (meaning that it should be in the right format for you.) 2. Have the display page handle all the dropdown logic. -- BigDog -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php