Subject is a bit misleading but I couldn't really find a good way to write it.
I have a form that has 3 fields for parts from a select box. All three fields will not always be filled. I then combine the fields and enter them into a mysql table. This is my combine string:
$parts = ("$part1; $part2; $part3");
The problem I'm having is when only 1 or 2 fields are filled, the seperators ( ; ) from my combine string appear in the database field obviously. If only 1 field is filled I don't want the data put into the table with superfluous characters. Right now If I queried on a record with 1 entry it would look like:
"Part1;;;"
How can I make a value combine make the distinction of blank fields and whether or not it needs to combine the part2 and part3? i.e. if only $part1 is filled, it only makes $parts = ("$part1). if $part1 and $part2 are filled, it makes $parts = ("$part1; $part2)?
Thanx much for the help!
Nico