SQL PHP中的更新不会更新

So i have this php project and the problem is this code;

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();
}

..and this doesn't update the value. Pls help

Seems like you've switched your SET and WHERE clauses.

Use this instead:

  $sql = "UPDATE lib_storeroom SET medicine_count = :medicine_count_prev + :medicine_qty WHERE medicine_id=:med_id";