来自https://www.php.net/manual/zh...
$sth->bindParam(':colour', $colour, PDO::PARAM_STR, 12);
12是啥意思?没看懂
<?php
$calories = 150;
$colour = 'red';
$sth = $dbh->prepare('SELECT name, colour, calories
FROM fruit
WHERE calories < :calories AND colour = :colour');
$sth->bindParam(':calories', $calories, PDO::PARAM_INT);
$sth->bindParam(':colour', $colour, PDO::PARAM_STR, 12);
$sth->execute();