mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given
Возвращает FALSE в случае неудачи. В случае успешного выполнения запросов SELECT, SHOW, DESCRIBE или EXPLAIN mysqli_query() вернет объект mysqli_result. Для остальных успешных запросов mysqli_query() вернет TRUE.
$stmt = mysqli_prepare($connect, "INSERT INTO *** (fio,email,age,anw1,anw2,frequency) VALUES (?, ?, ?, ?, ?, ?)");
mysqli_stmt_bind_param($stmt, "ssssss", $fio, $email, $age, $anw1, $anw2, $frequency);
mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
function search($needles, $haystack) {
$found = [];
array_walk_recursive($haystack, function($item, $key) use ($needles, &$found) {
if (in_array($key, $needles) && !in_array($key, $found))
$found[] = $key;
});
return (count(array_diff($needles, $found)) == 0);
}
print search(['foo', 'bar'], $a) ? 'true' : 'false';