Php, not getting any errors yet this code wont update database

Associate
Joined
11 Oct 2008
Posts
268
Hey guys, can anyone see what i have done wrong on this code, instead of updating my database it just does nothing at all, no errors, no noting.

PHP:
if ($enemy_hp <= 0) {

$sql = "UPDATE game_status SET battle = '1' WHERE id=1";

} else {

$sql = "UPDATE game_character SET current_hp = (current_hp-100) WHERE id=1";


    $statement = $dbh->prepare($sql); 
    $statement->execute();

}
 
Back
Top Bottom