My client has a php form that was multiple locations across the county, each location has a different email. They want to have a copy of the each email sent to the mail office.
Can I just add the office email into the SQL field for each location?
My client has a php form that was multiple locations across the county, each location has a different email. They want to have a copy of the each email sent to the mail office.
Can I just add the office email into the SQL field for each location?
This is not a SQL problem but a schema design problem. In a properly normalized database you'd have something like this:
CREATE TABLE office_emails (
id INT PRIMARY KEY AUTO_INCREMENT,
office_id INT,
address VARCHAR(255)
)
Then you have a one-to-many association between offices and email addresses for these offices. You can select out for a given office with:
SELECT address FROM office_emails WHERE office_id=?
Remember that email addresses are just strings as far as SQL is concerned, so you can do whatever you want to store them.