note 93457 added to mysqli.commit

From: Date: Thu, 10 Sep 2009 17:42:41 +0000
Subject: note 93457 added to mysqli.commit
Groups: php.notes 
Request: Send a blank email to php-notes+get-160430@lists.php.net to get a copy of this message
The compactness of Lorenzo's code is admirable. However, it is a good idea to also check $mysqli->affected_rows to make sure that the INSERT statement did not fail. $result_query = @mysqli_query($query, $connect); if (($result_query == false) && (mysqli_affected_rows($connect) == 0)) { // verify the query executed completely and verify that it // had impact on the table $success = false; // here also, the developer could choose to add a ROLLBACK // statement } ---- Server IP: 208.69.120.35 Probable Submitter: 65.175.164.185 ---- Manual Page -- http://www.php.net/manual/en/mysqli.commit.php Edit -- https://master.php.net/note/edit/93457 Del: integrated -- https://master.php.net/note/delete/93457/integrated Del: useless -- https://master.php.net/note/delete/93457/useless Del: bad code -- https://master.php.net/note/delete/93457/bad+code Del: spam -- https://master.php.net/note/delete/93457/spam Del: non-english -- https://master.php.net/note/delete/93457/non-english Del: in docs -- https://master.php.net/note/delete/93457/in+docs Del: other reasons-- https://master.php.net/note/delete/93457 Reject -- https://master.php.net/note/reject/93457 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#160430) next »