我有以下代码:
$db->beginTransaction();
$achievement_name = $db->prepare("SELECT `achievement_name` FROM `achievement_names` WHERE `id` = :a_id");
$achievement_name->bindValue(":a_id",$r['achievement_id'],PDO::PARAM_INT);
$achievement_desc = $db->prepare("SELECT `achievement_desc` FROM `achievement_names` WHERE `id` = :a_id");
$achievement_desc->bindValue(":a_id",$r['achievement_id'],PDO::PARAM_INT);
$achievement_image = $db->prepare("SELECT `image` FROM `achievement_names` WHERE `id` = :a_id");
$achievement_image->bindValue(":a_id",$r['achievement_id'],PDO::PARAM_INT);
$db->commit();
PDO可以做到这一点吗?拥有 $db->prepare() 和 bindValue() 函数然后提交它们?它似乎对我不起作用,因为它们返回 bool(false)。