if ( isset($_POST['check']) ) { $check = "some value"; } else { $check = "another value"; } $sql = "INSERT INTO users (check) VALUES ('$check')";