我是新來的PHP,並試圖動態地創建一個查詢。這是我得到foreach語法錯誤的一段代碼。可以請你幫我修復這個bug嗎?foreach內mysql查詢
$select = "SELECT pmid FROM articles WHERE pmid IN
("
foreach($results as $result) {
$select .= $result['pmid'] . ',';
}
$select = trim($select,','); .
")
";