MySQL Forums
Forum List  »  PHP

Re: php array saving only one record
Posted by: Peter Brawley
Date: September 09, 2019 01:26PM

1 To debug such a script fragment, echo the sql, ie ...

$sql = "...";

echo $sql;

... and inspect the values when it runs.

2. Calling mysqli_query(...) without either polling the result of the call or trapping errors is unsound. It hides problems. You need something like ...

$res = mysqli_query($connection, $sql);
If( !$res ) exit( mysqli_error($connection) );

Options: ReplyQuote

Written By
September 09, 2019 12:13PM
Re: php array saving only one record
September 09, 2019 01:26PM

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.