With a table setup as follows:
CID | FNAM | LNAME | CITY ------> 30 more fields
23432 | John | Doe | Denver
54342 | Jane | Doe | Boston
and when getting a result set this way (The query narrowed it down to 1 result):
$data = mysqli_query($con,$query);
$row = mysqli_fetch_array($data);
and using below to set each returned column in $row to a equivalent SESSION variable
foreach ($row AS $key=>$value) {$_SESSION["$key"]=$value;}
Why is it that I am getting a matching $_SESSION set with both the $key name, as well as a $_SESSION set with a numeric position in the array for each $row that was set to a session variable?:
echo $_SESSION['cid']; results in 23432
echo $_SESSION['0']; results in 23432
$_SESSION['cid'] is intended, but $_SESSION['0'] is not