Board index » Web Programming » pulling stuff from comma-delimited field
|
jpoquette
|
pulling stuff from comma-delimited field
Web Programming319
I have a page where I allow the user to select one or more names of employees to send an email to, which is sent automatically when the form is submitted. I have a field called EmailSentTo, and if you sent it to Joe Smith, then it stores the employee's number, 200, which is the PK of the Employee table. And there is, of course, another page which displays all the information from that form I just submitted, so I want to display this new thing I added, the name of the person I sent an email to. So far, no problem. The thing gets complicated when I choose to send the email to more than one person. In that case, I select Joe Smith and Mary Jones, and it enters "200,100" into the field. A comma-delimited set of empoloyee IDs. I realize that in order to display this, I would need some sort of loop, but I'm not sure about how to do this. I can do a loop which pulls different records from a table, but this is pulling several things from one field of one record. Anyone got any sample code? (BTW, I know that this is essentially a one-to-many, and I should simply break it down to another table, but I was trying to avoid that. But I will if that's the best thing to do) - |
