<?php
require_once 'init.php';
if(isset($_POST['username'], $_POST['password'])) {
$extractInfoUser = $db->prepare("
SELECT * FROM user
WHERE username = :username
");
$extractInfoUser->execute([
'username' => $_POST['username']
]);
$users = $extractInfoUser->rowCount() ? $extractInfoUser : [] ;
foreach ($users as $user) {
if ($user['username'] = null) {
die("There is no username like this !");
} else {
echo "You are not able to register under this username !";
}
}
}
?>
The problem is that I get as result nothing ! Please help cuz I can't find this error ! I have no idea what it can be !