English 中文(简体)
如何将数据从表格中显示为不同领域,在每一项目旁边有反响?
原标题:How to display data from table into separate fields and have a counter next to each item?
  • 时间:2011-11-24 11:31:29
  •  标签:
  • php
  • database

我已经拿到一张桌子,我需要从桌上获得一个装备:

DROP TABLE IF EXISTS `equipment`;
CREATE TABLE IF NOT EXISTS `equipment` (
`equipmentID` int(11) NOT NULL auto_increment,
`Description` varchar(255) NOT NULL,
`DateEntered` timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY  (`equipmentID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=20 ;

如何把所有设备放在我的营地网页上,以便用户能够选择他们想要的任何设备(超过1台),而且每件设备也有一个反面,以便用户能够说他们需要的每个项目有多少件?

Kind of like this:

items   quantity(determined by user)
item 1 - 2
item 2 - 3
item 3 - 1
最佳回答

设备表对我看上去是细微的,但正如你所说的那样,用户选择这似乎要求使用订购表格。

这意味着,例如,你应当有另一个储存采购细节表格。 用户——顺序——应当有田地如[ER ID][Item ID] [估算] i 知道它可能不是正确的结构,而只是要说明你如何能够将该项目储存到特定客户的要求中。

这是问题的答案吗?

问题回答

您可以使用检查箱,如:

<form>
<input type="checkbox" name="vehicle" value="Bike" /> 
<input type="checkbox" name="vehicle" value="Car" /> 
</form>

and when you submit or click a button you can retrieve the number of items that are checked and send them to anywhere you need to process.





相关问题
what is wrong with this mysql code

$db_user="root"; $db_host="localhost"; $db_password="root"; $db_name = "fayer"; $conn = mysqli_connect($db_host,$db_user,$db_password,$db_name) or die ("couldn t connect to server"); // perform query ...

Users asking for denormalized database

I am in the early stages of developing a database-driven system and the largest part of the system revolves around an inheritance type of relationship. There is a parent entity with about 10 columns ...

Easiest way to deal with sample data in Java web apps?

I m writing a Java web app in my free time to learn more about development. I m using the Stripes framework and eventually intend to use hibernate and MySQL For the moment, whilst creating the pages ...

join across databases with nhibernate

I am trying to join two tables that reside in two different databases. Every time, I try to join I get the following error: An association from the table xxx refers to an unmapped class. If the ...

How can I know if such value exists in database? (ADO.NET)

For example, I have a table, and there is a column named Tags . I want to know if value programming exists in this column. How can I do this in ADO.NET? I did this: OleDbCommand cmd = new ...

Convert date to string upon saving a doctrine record

I m trying to migrate one of my PHP projects to Doctrine. I ve never used it before so there are a few things I don t understand. In my current code, I have a class similar to this: class ...

热门标签