note 113000 added to mysqli.commit
| From: | snchzantonio at gmail dot com | Date: | Fri, 16 Aug 2013 17:38:37 +0000 |
| Subject: | note 113000 added to mysqli.commit | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-196003@lists.php.net to get a copy of this message | ||
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
//variants combined
$mysqli->autocommit(FALSE);
try{
$mysqli->query("INSERT INTO myCity (id) VALUES (100)") or throw new
Exception('error!');
// or we can use
if( !$mysqli->query("INSERT INTO myCity (id) VALUES (200)"){
throw new Exception('error!');
}
}catch( Exception $e ){
$mysqli->rollback();
}
$mysqli->commit();
?>
----
Server IP: 69.147.83.199
Probable Submitter: 201.248.18.239
----
Manual Page -- http://php.net/manual/en/mysqli.commit.php
Edit -- https://master.php.net/note/edit/113000
Del: integrated -- https://master.php.net/note/delete/113000/integrated
Del: useless -- https://master.php.net/note/delete/113000/useless
Del: bad code -- https://master.php.net/note/delete/113000/bad+code
Del: spam -- https://master.php.net/note/delete/113000/spam
Del: non-english -- https://master.php.net/note/delete/113000/non-english
Del: in docs -- https://master.php.net/note/delete/113000/in+docs
Del: other reasons-- https://master.php.net/note/delete/113000
Reject -- https://master.php.net/note/reject/113000
Search -- https://master.php.net/manage/user-notes.php