MySQL Forums
Forum List  »  PHP

Re: Double Insert
Posted by: Peter Brawley
Date: October 15, 2019 09:21PM

Sorry, unsound code, eg after ...

> $query_PDO = $db->query($query_STR);

... you need to check for MySQL errors, check that $query_pdo is a valid result object, and check rows returned. The next line ..

while ( $rec_Col = $query_PDO->fetch(PDO::FETCH_ASSOC) ) {

.. should never execute if $query_pdo fails any of those tests, and if it does, the loop should with tests of the fetch result.

If there's a debug flag, then the c ode can show you all such test detail results when set.

Options: ReplyQuote

Written By
October 14, 2019 12:16AM
October 15, 2019 10:11AM
October 15, 2019 10:54AM
October 15, 2019 11:06AM
October 15, 2019 12:16PM
October 15, 2019 12:30PM
October 15, 2019 12:42PM
October 15, 2019 12:53PM
October 15, 2019 01:04PM
Re: Double Insert
October 15, 2019 09:21PM
October 15, 2019 10:17PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.