Multiple data entries in one Field.
Posted: Wed Feb 13, 2008 10:57 am
Hi, I'm new to PHP and MySQL. I'm creating a simple database with MySQL that contains information on empolyees at a company. The fields inside the database include forename, surname, job_title etc. I've made a PHP page that allows me to select a name from a drop down menu and then display the information about the person.
Expanding on this, I want to add information on the training the person has recieved. They're are 25 training modules and I want the page to display the ones the selected employee has completed. However, I don't know the best way to do this. I could just place a long sting into a field and display it like that but it would be impratical to edit it again when another module completed by an employee is needed to be added. I thought of doing a method where I store ID numbers for the modules in a string and then when the new page is processed it would take the numbers and then display the module names based on the ID numbers in the string. This would mean only one set of strings would need to be stored and would hopefully allow me to add and remove modules for that employee but it still seems impratical. I'd also have to find a way off seperating the ID numbers and putting them into variables so that the actually ID number could be used to find the corresponding Training Module name. Are they're any better, more efficient, ways of doing this?
Expanding on this, I want to add information on the training the person has recieved. They're are 25 training modules and I want the page to display the ones the selected employee has completed. However, I don't know the best way to do this. I could just place a long sting into a field and display it like that but it would be impratical to edit it again when another module completed by an employee is needed to be added. I thought of doing a method where I store ID numbers for the modules in a string and then when the new page is processed it would take the numbers and then display the module names based on the ID numbers in the string. This would mean only one set of strings would need to be stored and would hopefully allow me to add and remove modules for that employee but it still seems impratical. I'd also have to find a way off seperating the ID numbers and putting them into variables so that the actually ID number could be used to find the corresponding Training Module name. Are they're any better, more efficient, ways of doing this?