Jump to content

Getting data from MYSQL into drop down menu.


smonkcaptain

Recommended Posts

Hello all,

 

I'm currently making an upload form for a photography website, in which i want to include a 'Camera Body' and 'Lens' field to be displayed next to the uploaded image.

 

I've made the form, and would like to be able to get the 'camera body' and 'lens' data from the 'members' mysql database into a drop down list on the form.

 

Obviously, this data would change dependent on which member was logged into the site.

 

I hope you can help me and if you require any more information, just ask.

 

Thanks! Jimmy Leaman

I think this is too complex a solution to post on a forum, but i'll break the logic down how i see it:

 

1. In the member database create too columns, for lens and for camera body

 

2. Create a form for members to register their different types of camera body and lens

 

2.1. On submission, store the registered items in arrays

 

2.2. Commit array of items to database by using the serialize() function

 

3. When member uploads photograph, use unserialize() function to make the array readable again

 

4. Use the foreach() function to create a new list item for each camera body and lens stored in the array

 

 

Honestly i wouldn't consider making a solution like this for someone without getting paid :P

 

Hope what i said helps anyway.

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.