-1
這裏是我想問:註冊 - 登錄數據庫計劃
我想製作一個系統註冊病人,然後他們將能夠登錄。儘管我有3種類型的用戶。
- 管理(無需註冊)
- 醫生(標準編號醫生,無需註冊)
- 患者(他們將被註冊)
我想保留更多信息對他們來說不僅僅是id,用戶名,密碼,電子郵件。 我想有超過1個表來做到這一點,原發性鍵和外鍵關聯人:
1st table accounts (it will store the login data) Example: acc_id(primary key) acc_password acc_username acc_type
2nd table doctors_extra_info Example: acc_id (foreign key) doc_info_id (primary key) doc_name ... ...
3rd table patients_extra_info Example: acc_id (foreign key) pat_info_id (primary key) pat_name ... ...
4th table admin_info Example: acc_id (foreign key) admin_id (primary key) admin_email
- 一個。這是做這件事的最好方法?
- b。在註冊部分 ,如何處理主鍵和外鍵?兩個插入 命令在兩個不同的表中? [爲了在帳戶表和附加信息表中具有相同的acc_id ]
- c。在登錄部分, 我需要檢查用戶的類型和重定向(標題(位置:..);) 到頁面?這是做這件事的正確方法嗎?
有什麼建議嗎? 謝謝。
那麼我的情況下有多少桌?因爲我想在每種類型的用戶中有不同的列。 – Andrew