implode(separator,array) 函數返回一個字符串的內容陣列。
separator: Optional. Specifies what to put between the array elements. Default is "" (an empty string)array: Required. The array to join to a string
SQL語法,IN裡面要有單引號包著
SELECT "欄位名"
FROM "表格名"
WHERE "欄位名" IN ('值一', '值二', ...)
在SQL中要用到IN時,可以使用implode function
$item = implode("','",$item_arr); ---> IN ('$item')
$item = "'".implode("','",$item_arr)."'"; ---> IN ($item)
IN('" . implode("','", $item_arr)."')
0 意見:
張貼留言