将多个值分配给字段并在网页上显示它 [英] Assign Multiple Values to a Field and Display it on Web Page

查看:74
本文介绍了将多个值分配给字段并在网页上显示它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在phpmyadmin中创建了一个表,我很想知道是否可以为同一个表中的一个变量/字段分配多个值。例如,这就是我所拥有的:



ID |鞋|尺寸

____________________

1 | CK | 7

____________________

2 | LV | 7

____________________

3 |普拉达| 7

____________________

4 |耐克| 7

____________________

5 |彪马| 7

____________________




这就是我想要的:



ID |鞋|尺寸

____________________________

1 | CK | 7,7.5,8,8.5

____________________________

2 | LV | 7,7.5

____________________________

3 |普拉达| 7

____________________________

4 |耐克| 7,8,9

____________________________

5 |彪马| 6,6.5,7,

____________________________


我不确定我是否有任何意义(我不介意重新澄清我说的话)。



此外,是否有一种在网页上显示表格的技巧?我尝试使用PHP并搜索谷歌,看看我是否能找到任何解决方案,但我只是更困惑自己。那么我如何拉取数据并在网站上显示呢?



谢谢!

I created a table in phpmyadmin and i was curious to know if it is possible to assign multiple values to one variable/field in the same table. For example here is what i have:

ID | Shoe | Sizes
____________________
1 | CK | 7
____________________
2 | LV | 7
____________________
3 | Prada | 7
____________________
4 | Nike | 7
____________________
5 | Puma | 7
____________________


This is what I want:

ID | Shoe | Sizes
____________________________
1 | CK | 7, 7.5, 8, 8.5
____________________________
2 | LV | 7, 7.5
____________________________
3 | Prada | 7
____________________________
4 | Nike | 7, 8, 9
____________________________
5 | Puma | 6, 6.5, 7
____________________________

I am not sure if i made any sense (i don't mind re-clarifying what i said).

Also, is there a technique in displaying a table on a web page? I tried using php and searched google to see if i could find any solutions but i only confused myself more. So how can i pull the data and display it on the site?

Thanks!

推荐答案

I认为你需要系统地学习如何构建一个数据库驱动的Web应用程序,



你在一个领域放置多个价值的第一个想法是一个很大的错误,那个违反了关系数据库设计中的第一范式规则。有一篇关于这个 11条重要数据库设计规则的文章很好按照 [ ^ ]。您可以向谷歌询问关于关系数据库设计和相关事宜的更多信息。



您关于'技术'的下一个问题,最低限度,您需要了解以下方面:

1. 学习HTML [ ^ ]

2. 学习JavaScript [ ^ ]

3. 学习PHP + MySQL [ ^ ]



你应该学习这些按顺序,耐心地试试他们的例子。



请记住罗马不是一天建成的
I think you need a systematic learning on how to build a database-driven web application,

Your first ideas of putting multiple value in a single field is a big mistake, that is a violation of "first normal form" rule in relational database design. There is a good article on this 11 important database designing rules which I follow[^]. You can ask google for more information on relational database design and related matters.

Your next question about 'technique', minimally, you will need knowledge of the following areas:
1. Learn HTML[^]
2. Learn JavaScript[^]
3. Learn PHP+MySQL[^]

You should learn these in sequence, with patience and try out their examples.

Remember that "Rome was not built in one day".


这篇关于将多个值分配给字段并在网页上显示它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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