0

I am looking to build a table in PHP/MySQL where NAME, ADDRESS, MOBILE, CERTIFICATE of a candidate can be stored. In CERTIFICATE field (column) I want to store multiple certificates of the candidate. Could anyone please let me know how multiple files can be store in a column and how to access it later?

1
  • I would suggest to store each certificate separately and have a OneToMany relation to the table, that hold old those certificates. But if you think that you do not need to store it this way, try to store all certificates as a json value in a text field Commented Sep 8, 2020 at 13:25

1 Answer 1

2

You don't store multiples of anything in a single column value. That's not the way SQL databases work. You make a separate table, maybe called cert. It will have, at least, these columns.

cert_id        INT  autoincrementing primary key
candidate_id   INT  the id of the candidate owning this certificate
certificate    (You didn't tell us the data type of this)

Then, a candidate can have zero, one, or more certificates. This is called a one-to-many relationship in the parlance of entity-relationship database design.

Pardon me for being so blunt. But you still have time to avoid this common, but very serious, mistake of trying to put multiple things in one column value. It's a mistake that can make your system hard to maintain in the future.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.