Below is my code to retrieve the column names from the table "COLUMNS" of database "INFORMATION_SCHEMA".
$result = mysqli_query($con,"SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'CustomersTable'") or die(mysqli_error($con));
$columns = $result;
foreach ($columns as $column){
echo $column;
}
what I get echoed is ArrayArrayArrayArrayArrayArrayArrayArray. However, if I write
mysqli_fetch_assoc($result);
instead of
$columns = $result;
then I get only the first value of the array echoed.
How do I get all the values echoed as I expect it to be?