MySQLi result seems to be duplicating columns as you can see below in the screenshots. The data for each column seems to be duplicated.
Any thoughts one what I am doing wrong?
The DB Call
function getDBConnection() { // Connect to the database mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); $conn = new mysqli( DBHOST, DBUSER, DBPWD, DBNAME ); if ( $conn->connect_error ) { die( "Failed to connect with MySQL: " . $conn->connect_error ); } else { return $conn; }
}
function getAllCustomers() { $conn = getDBConnection(); $sql = "SELECT * FROM tblCustomers" ; return $conn->query( $sql );
}
Outputting in PHP
$records = getAllCustomers();
if (mysqli_num_rows($records) > 0) { while ($row = mysqli_fetch_array($records)) { echo '