【发布时间】:2011-02-07 22:16:09
【问题描述】:
我正在构建一个我在 mysql db 中签入的字符串。
eg:
formFields[] is an array - input1 is: string1
array_push(strings, formFields)
1st string and mysql query looks like this:
"select * from my table where id in (strings)"
formFields[] is an array - input2 is: string1, string2
array_push(strings, formFields)
2nd string and mysql query looks like this:
"select * from my table where id in (strings)"
formFields[] is an array - input3 is: string1, string2,string3
array_push(strings, formFields)
3rd string and mysql query looks like this:
"select * from my table where id in (strings)"
我想在数组中添加单引号和逗号,这样我就有了数组字符串: "select * from my table where id in ('string1', 'string2','string3')"
我尝试使用数组内爆,但仍然没有任何想法?谢谢
【问题讨论】: