数据库中列出的项目的分隔符而不是逗号? [英] seperator instead of a comma for listed items in DB?
问题描述
我正在创建一个配方数据库,并且需要在mySQL中有数据库字段
将包含将被发送到数组的值列表
on。
我预计有时需要在值中使用逗号
本身。那么,什么是常用的符号或人们倾向于使用的东西作为列表的分隔符,然后将用于split()
函数将元素发送到数组中?
几乎每个标点符号都有可能存在于实际数据中。任何
的建议?
谢谢!
利亚姆
I''m making a recipe database, and need to have DB fields in mySQL that
will have lists of values that would get sent to an array to be worked
on.
I anticipate that at times a comma will need to be used in the value
itself. So, what''s a commonly used symbol or something that people tend
to use as a separator of a list that would then be used in the split()
function to send the elements into an array?
Nearly every punctuation has a chance of being in the actual data. Any
suggestions?
Thanks!
Liam
推荐答案
ne**@celticbear.com 写道:
我是制作食谱数据库,并且需要在mySQL中有数据库字段,这些数据库将包含可以发送到阵列的值列表。
我预计有时候需要在值中使用逗号
。那么,什么是常用的符号或人们倾向于用作列表的分隔符,然后在split()
函数中使用它来将元素发送到数组中? br />
几乎每个标点符号都有可能存在于实际数据中。有什么建议吗?
谢谢!
Liam
I''m making a recipe database, and need to have DB fields in mySQL that
will have lists of values that would get sent to an array to be worked
on.
I anticipate that at times a comma will need to be used in the value
itself. So, what''s a commonly used symbol or something that people tend
to use as a separator of a list that would then be used in the split()
function to send the elements into an array?
Nearly every punctuation has a chance of being in the actual data. Any
suggestions?
Thanks!
Liam
通常垂直条''|''是个不错的选择。 />
-david-
Usually the vertical bar ''|'' is a good choice.
-david-
ne ** @ celticbear.com 写道:
我正在制作一个食谱数据库,并且需要在mySQL中有数据库字段
将有值列表这将被发送到一个阵列进行工作
我预计有时候需要在值中使用逗号
。那么,什么是常用的符号或人们倾向于用作列表的分隔符,然后在split()
函数中使用它来将元素发送到数组中? br />
几乎每个标点符号都有可能存在于实际数据中。任何
建议?
谢谢!
Liam
I''m making a recipe database, and need to have DB fields in mySQL that
will have lists of values that would get sent to an array to be worked
on.
I anticipate that at times a comma will need to be used in the value
itself. So, what''s a commonly used symbol or something that people tend
to use as a separator of a list that would then be used in the split()
function to send the elements into an array?
Nearly every punctuation has a chance of being in the actual data. Any
suggestions?
Thanks!
Liam
我通常使用ASCII控制字符。 0x1E被指定为
记录分隔符。不知道MySQL是否会接受它。
I usually use an ASCII control character. 0x1E is designated as a
record seperator. Don''t know if MySQL would accept it or not.
Chung Leong写道:
Chung Leong wrote:
ne**@celticbear.com 写道:
我正在制作食谱数据库,需要在mySQL中有数据库字段
将包含将被发送到阵列的值列表
我预计有时需要逗号用于价值
本身。那么,什么是常用的符号或人们倾向于用作列表的分隔符,然后在split()
函数中使用它来将元素发送到数组中? br />
几乎每个标点符号都有可能存在于实际数据中。任何
建议?
谢谢!
Liam
I''m making a recipe database, and need to have DB fields in mySQL that
will have lists of values that would get sent to an array to be worked
on.
I anticipate that at times a comma will need to be used in the value
itself. So, what''s a commonly used symbol or something that people tend
to use as a separator of a list that would then be used in the split()
function to send the elements into an array?
Nearly every punctuation has a chance of being in the actual data. Any
suggestions?
Thanks!
Liam
我通常使用ASCII控制字符。 0x1E被指定为
记录分隔符。不知道MySQL是否会接受它。
I usually use an ASCII control character. 0x1E is designated as a
record seperator. Don''t know if MySQL would accept it or not.
有趣。
我必须搜索控制字符和那个0x1e,因为我
不知道它们是什么。
(好吧,除了Windows我知道我可以用ALT +(numpad)来写ASCII
字符,但这不是重点。
显然0x1e显示为两个carrets:^^
当我创建完整值那会进入这个领域,我会不会在它被发送到
mySQL之前在不同的值之间插入^^,然后使用^^作为split()分隔符?
或者我是否必须以某种方式使用该0x1e标签?
^^是否告诉mySQL或PHP一些特别的东西?
我似乎无法在谷歌上找到任何东西。
感谢您的回复!
-Liam
Interesting.
I had to do a search on control characters and that 0x1e, because I
have no idea what they are.
(Well, except in Windows I know I can use ALT+(numpad) to write ASCII
characters, but that''s beside the point.
Evidently 0x1e is shown as two carrets: ^^
When I create the full value that would go into the field, would I
simply insert ^^ between the different values before it gets sent to
mySQL, and then use ^^ as the split() seperator?
Or do I have to use that 0x1e label in some way?
Does the ^^ tell mySQL or PHP something special?
I can''t seem to find anything with Google on it.
Thanks for the reply!
-Liam
这篇关于数据库中列出的项目的分隔符而不是逗号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!