My code creates an array like this
$stmt = $pdo->prepare("SELECT uniqueid, firstname, lastname, email, notify FROM information WHERE userid = ? AND notify = 'yes'");
$stmt->execute([$userid]);
foreach ($stmt->fetchAll(PDO::FETCH_ASSOC) as $row) {
//get emails
$notifyemailsarray[$row['email']]=$row;
}
After that query runs (or possibly even before it runs), I would like to add one specific set of data to that array, but only email, firstname and lastname. So I tried this...
$specificemail="[email protected]";
$specificfirstname="Bob";
$specificlastname="Jones";
$notifyemailsarray[$specificemail] = array('firstname' => $specificfirstname, 'lastname' => $specificlastname);
But when I print_r that array afterwards, I don't see the "specific" info that I added separately. I do see the data that was populated from the PDO query, just not the "specific" stuff. What am I doing wrong?
[email protected]appear in the database too, perhaps?