->execute()
is for prepared statements. e.g.
$stmt = $dbh->prepare('some query here');
$stmt->execute();
You're trying to execute a query directly on the main DB object. For PDO, that means
$dbh->exec('query goes here');
You really should look into prepared statements. You're vulnerable to SQL injection attacks as is, and since you're using PDO to begin with, it's basically unforgivable to NOT be writing safe queries.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…