View Single Post
  #1 (permalink)  
Old 10-14-04, 12:50 PM
cebuy cebuy is offline
Newbie Coder
 
Join Date: Jun 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Multiple form fields saved in one mysql field??

This maybe an elementary question to post in this forum, but I am stumped and need a bit of help (I am a newbie to php). I have 3 drop down fields in a form. Each drop down list is the same list of cities. I would first of all want to know how to go about saving the 3 fields as a comma seperated list in one mysql field. I am guessing that I cannot with just simple html since it would require a separate field in the mysql for each name ...and if I name them the same field name, probably only one would get listed in the mysql field. I think it will require php to merge them together.

Example...
<select size="1" name="City1">
<option>Atlanta</option>
<option>Athens</option>
<option>Rome</option>
<option>Thomasville</option>
</select>

<select size="1" name="City2">
<option>Atlanta</option>
<option>Athens</option>
<option>Rome</option>
<option>Thomasville</option>
</select>

Saved under Mysql Field 'city' as
"Athens,Rome"
instead of having to save as mysql field 'city1' = 'Athens' & 'city2' = 'Rome'

Any IDEAS?
Chris Chandler
Quoting Loans
Reply With Quote