I never recomend to use the ? with only one value variant like: $var = expression ? $var : other_value or $var = expression ? null : other_value ,and php suport Exception catchin so,use it :)
here my opinion abut lorenzo's post:
<?php
$mysqli->autocommit(FALSE);
try{
$mysqli->query("INSERT INTO myCity (id) VALUES (100)") or throw new Exception('error!');
if( !$mysqli->query("INSERT INTO myCity (id) VALUES (200)"){
throw new Exception('error!');
}
}catch( Exception $e ){
$mysqli->rollback();
}
$mysqli->commit();
?>