0
I have two Row and mailTeste arrays, one of them comes from my database and is already populated, within it has two Row["email"] and Row["id] I want to pass to my other array that will be used inside a foreach to print the results on the screen, I intend to use this mailTeste to make comparisons with future data additions in this database.
The problem is that I am unable to pass Row data to my Mailteste array.
$query = "SELECT TabelaX.email, TabelaX.id, TabelaY.whitelist FROM email RIGHT JOIN whitelist ON TabelaX.id = TabelaY.sid WHERE rid='0' ORDER BY email";
$result = mysql_query($query);
$W_list = "";
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$Email_ot = array(
$row["email"] => $row["id"]
);
}
In this top code block I take the data (email and id) of the database and step to Row, soon after create the $mailTeste array to save the information.
foreach ($Email_ot as $email => $id) {
if (in_array($email, $wlistTeste)) {
echo "existe no array<br>";
} else {
echo "não existe: ";
printf($email . '<br>');
}
}
This foreach is used to confirm that the data that has been placed inside an input is already in the database.
Where is the array
mailTeste
? I didn’t see her in the code presented.– Sam