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 getDBCoection() {
// Coect to the database
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$co = new mysqli( DBHOST, DBUSER, DBPWD, DBNAME );
if ( $co->coect_error ) {
die( "Failed to coect with MySQL: " . $co->coect_error );
} else {
return $co;
}
}
function getAllCustomers() {
$co = getDBCoection();
$sql = "SELECT * FROM tblCustomers" ;
return $co->query( $sql );
}
Outputting in PHP
$records = getAllCustomers();
if (mysqli_num_rows($records) > 0) {
while ($row = mysqli_fetch_array($records)) {
echo '
