如何在数据库中存储多个复选框值 [英] How to store multiple checkbox value in database
问题描述
你好朋友
我正在开发一个医疗管理项目.在那我有以下表格
表1)Components_details
字段:1. Component_id,2.Component_name,3.Componenet的用途
表2)Medicine_Details
栏位:1. Medicine_id,2.Medicine_name,3.药物用途
假设我想添加许多成分来创建药物,那么在这种情况下,我需要为一种药物选择多个成分,并选择其成分来制成药物.如何存储单一药物的组合详细信息,请帮助我.
谢谢
Hi friends
I am developing a medical management project. In that I have following tables
Table 1) Components_details
fields: 1. Component_id ,2.Component_name ,3.Uses Of componenets
Table 2) Medicine_Details
fields: 1. Medicine_id ,2.Medicine_name,3.Uses of medicines
suppose I want to add many components for creating medicine, in that situation I need to select multiple components for single medicine with their percentage to make a medicine. how can i store combination details for single medicine.please help me.
thank you
推荐答案
您知道主明细表结构吗?
您可以使用Medicine_id制作一张明细表.那张桌子可以像这样:
Hi,
Do you know about Master detail table structure?
You can make one detail table with your Medicine_id. That table can be like this :
TableName : Medicine_Components_Details
1. MCDID(PK)
2. Medicine_id
3. Component_id
因此,您可以在这里获得1种药物的所有成分.
希望这些信息对您有所帮助.
谢谢,
Viprat
So here you can get all Components for 1 Medicine.
I hope this information help you.
Thanks,
Viprat
这篇关于如何在数据库中存储多个复选框值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!