Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
なぜこれがうまくいかないのですか?
$stmt = $pdo->prepare("SELECT :columns FROM table"); $stmt->bindParam(':columns', implode(', ', $columns), PDO::PARAM_STR);
これを行う有効な方法はありますか?上記の最初のコードと同じくらい簡単でしょうか?
$pdo->prepare('SELECT ' . implode(', ', $columns) . 'FROM table');