0
<?php
if (isset($_POST['sendRecover'])) {
$recover = strip_tags(trim($_POST['email']));
$readRec = read($link, 'up_users', "WHERE email = '$recover'");
if (!$readRec) {
$rc = mysqli_fetch_array($readRec) >= 1;
echo '<span class="ms no">Erro: Email Inválido!</span>';
} else {
foreach ($readRec as $rec) {
if ($rec['nivel'] == 1 || $rec['nivel'] == 2) {
}
?>
I don’t know why I made a mistake:
Warning: Invalid argument supplied for foreach() in D: wamp64 www CURSOS projeto_pro_php admin lembrar_password.php on line 15
There is a mysqli query before that comes from a function but select is right, already tested, my syntax there is wrong and I did not hit.
This Warning general rule means that the
foreach
is not receiving aarray
as it should. I suggest that before theforeach
dovar_dump($readRec);
to be sure of exactly what is being passed on.– Isac
varival is not an array returned a path, so I switched to print_f, then returned me the amount of a record, but worth!!
– Francisco