我试图用PDO写一个更新查询,但它不起作用
for ($count = 0; $count < 4; $count++) {
if (!trim($elements[$count])=='') {
$query = "update servers set " . '?' . "=" . '?' . "where " . '?' . "=" . '?';
$pdo = new PDO($db->dsn, 'adp', 'pass');
$stmt = $pdo->prepare($query);
$stmt->bindParam(1, $index[$count]);
$stmt->bindParam(2, $elements[$count]);
$stmt->bindParam(3, $index[$count]);
$stmt->bindParam(4, $ServerName);
$stmt->execute();
}
}