如何在MySQL数据库中添加单个用户的多个地址 [英] How can I add multiple addresses of single user in MySQL database

查看:514
本文介绍了如何在MySQL数据库中添加单个用户的多个地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要帮助。我想在数据库中有两个表。一个是用户密码。我想为在USER表中添加的用户添加多个地址。我怎样才能做到这一点 ?谢谢。

i need help. I want to have two tables in database. One is USER n othetis ADDRESS. I want to add multiple addresses for the user that is added in USER table. How can i do this ? Thank you.

推荐答案

1st:您可以在地址表中添加用户唯一ID。

1st : You can add user unique id in address table .

第二个:还要在地址表中保持auto_increment主键,为什么意味着当您要编辑地址时意味着您需要更新正确的主键,因此非常有用将来,请为此保留一个专栏。

2nd : And also maintain auto_increment primary key in address table why means when your going to edit the address means you need to update the right one so it's useful in future so maintain one column for that .

这篇关于如何在MySQL数据库中添加单个用户的多个地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆