php - How can I add multiple addresses of single user in MySQL database -


i need help. want have 2 tables in database. 1 user n othetis address. want add multiple addresses user added in user table. how can ? thank you.

you have 2 different tables:

1) user

2) address

give foreign key id of user table address table

example:

user

id    name    email 1     abc     xxx@xxx.com 

address

id    user_id      address detail 1      1          address detail 1 2      1          address detail 2 

here user 1 has 2 address. can add more address also


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -