所以我有这个php项目,问题是这个代码;
try{
$pdo->beginTransaction();
$sql = "UPDATE lib_storeroom SET medicine_id=:med_id WHERE medicine_count = :medicine_count_prev + :medicine_qty";
$s = $pdo -> prepare($sql);
$s -> bindValue(':med_id', $_SESSION['med_id_pull']);
$s -> bindValue(':medicine_count_prev', $_SESSION['med_qty']);
$s -> bindValue(':medicine_qty', $_SESSION['replenish_qnty']);
$s -> execute();
$pdo->commit();
}
..并且这不会更新值。请帮忙
答案 0 :(得分:0)
好像您已经切换了var1 = '1'
var2 = '2'
print (var1 + var2)
和SET
条款。
请改用:
WHERE