need help - arrays for multiple select lists in CGI/HTML
I have a big problem at the moment. I am designing a website that will connect to a database. This website will allow users to upload posts in regards to certain topics. Upon registration of this website, they are also going to be able to chose who they wish to be friends with, so they can easily access their friends posts and communicate with them.
So basically, the database will hold a list of users, this list will grow over time (however, I doubt it will grow that big). Currently, the best way of implementing this ability to select who you want to be friends with is this:
1. the registration part of site will load fields (using CGI/HTML scripts created from python) for entering user details.
2. Then there will be some sort of select table where all users in the database is displayed (so this list will never be one particular size as users grow over time).
3. This list will allow you to select multiple friends. You can select one, or more friends. You can even select NONE as an option if you don’t know anyone yet.
4. Once user submits form, the python script will find exactly who this user wants to be friends with and create right entries for that in the database.
The database access is all ok for me, what I don’t know how to do is have some cgi/html code that will load all the users into a table where u can select from. I was thinking of using this:
<select multiple="multiple" size="8">
But then for the option value part I would need to use an array list of variables. Is it possible to get something like that? Or is there any other way of doing this?
Further, is this method of implementing this feature good or is there a better way?
I really appreciate any help you provide, thank you everyone.
Last edited by logik25; 05-21-2010 at 11:09 AM..
Reason: didnt paste code sample properly