简体   繁体   English

MySQL DB单个字段与多个其他字段匹配

[英]Mysql DB single field matching to multiple other fields

Ok, so I am creating a sort of dating service and I have a DB that requires a field to match up against multiple other fields. 好的,所以我正在创建一种约会服务,并且我有一个数据库,该数据库要求一个字段与多个其他字段匹配。 They need to be stored, so that they can be ignored and set as maybes for later viewing. 它们需要存储,以便可以忽略它们并设置为以后查看。 I know that setting up a comma delimited field is usually unwise, but I cannot figure out a better way to keep track of the matches while being able to categorize them into separate columns later on. 我知道设置逗号分隔的字段通常是不明智的,但是我想不出一种更好的方法来跟踪匹配项,同时又可以稍后将它们归类为单独的列。

Does anyone have any better way of doing this without the comma delimited field? 没有逗号分隔的字段,没有人有更好的方法吗?

how about an array? 数组怎么样? You can store an array of information in a database. 您可以在数据库中存储一系列信息。 in php just declare it as such: variable = array(); 在php中只是这样声明:variable = array(); then you can deal with variable as an array by using for loops, variable[index#], etc. Hope this helps! 那么您可以使用for循环,variable [index#]等将变量作为数组处理。希望这会有所帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM