PDO bindParam 参数length没看懂

来自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();

阅读 88
评论
    撰写回答

    登录后参与交流、获取后续更新提醒

    相似问题
    推荐文章