在POST和获取时保持关系。 [英] maintaining relation while POSTing and while fetching.

查看:35
本文介绍了在POST和获取时保持关系。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友....

我在FC4上用PHP-MySql开发一个项目.....

我正面临着一个问题在这里的一个地方。让我来形容它....


我在php中有一页我正在生成一个包含选项复选框的表。这些选项包含子选项。用户需要选择这些选项和子选项。通过子选项,他们可以获得文本框,可以在其中输入子按钮的值。当他们提交表单时,我需要获取所有这些数据并相应地将它们存储到数据库中。

现在出现问题是因为所有这些复选框和文本框都是通过数据库中的值动态生成的。所以我已经为所有这些做了一个数组,这样我就可以得到所选复选框和文本框的值。所以问题是在第二页上,我无法确定哪个子选项和文本框值到哪个选项意味着关系被破坏我需要维护这种关系,以便我可以将这些值存储在数据库中维护外键..


现在让我描述一下我的数据库,这样如果你还有其他选择,那么你可以建议我。


在数据库中我有四个表说table1,table2,table3和table4。


Table1包含OPTION的名称和它拥有的SUBOPTION的NUMBER。

Table2包含它们所属的SUBOPTIONS和OPTIONS的名称(外键)
<表3类似于表1,表4类似于表2(添加了一个字段,它将存储用户在运行时提供的TEXTBOXES的SUBOPTION值。)


所以我正在做的是分别从Table1和2获取OPTIONS和SUBOPTIONS值并生成表单。因此,当用户提交表单时,我想将这些值分别存储到表3和表4中。


我告诉你我在做什么。所以,如果你可以帮助它的好处,如果你对GUI有任何其他想法,请告诉我。

Hello friends....
I''m developing one project in PHP-MySql on FC4.....
I''m facing a problem here at one place. Let me describe it....

I''ve one page in php on which i''m generating a table containing checkboxes for option. These options have suboptions. User need to chose these options and suboptions. with suboption they are getting textboxes in which they can enter values for suboptons. When they submit the form i need to get all these data and accordingly store them into the database.
Now problem comes because all these checkboxes and textboxes are generated dynamically meaning through values in database. So i''ve made an arrays for all these so that i can get the values of selected checkboxes and textboxes. So the problem is on the second page i cant determine which suboption and textbox value goes to which option means relation is broken i need to maintain this relation so that i can store these values in database maintaining foreign key..

Now let me describe my database a bit so that if you have any other option then this you can suggest me.

In database i''ve four tables say table1,table2,table3 and table4.

Table1 contains name of OPTION and NUMBER of SUBOPTION it has.
Table2 contains name of SUBOPTIONS and OPTIONS they belongs(foreign key)

Table3 is similar to Table1 and Table4 is similar to Table2(with one field added which will store the value of SUBOPTION coming through TEXTBOXES which user is providing at runtime.)

So what i''m doing is getting the OPTIONS and SUBOPTIONS values from Table1 and 2 respectively and generating form. So when user submits the form i want to store these values into Table3 and 4 respectively.

I told you what i''m doing. so if you can help with that its good and if you have any other idea with GUI as well let me know.

推荐答案

这是一个计划,而不是问题。

我必须猜测你的问题是你不知道如何阅读表格值。

你使用
This is a plan, not a problem.
I have to guess your problem is you don''t know how to read form values.
Well you use the


_POST数组从表单中提取数据
_POST array to extract data from a form



这是一个计划,不是问题。

我有猜你的问题是你不知道如何阅读表格值。

你使用
This is a plan, not a problem.
I have to guess your problem is you don''t know how to read form values.
Well you use the


这篇关于在POST和获取时保持关系。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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