I did that, and now I'm getting nothing, which probably means there's a problem with 'foo'. I put the statement "echo $data" in, like:
$data = mysqli_query("SELECT * FROM login_data WHERE username = '$user';",$dbc)
or die(mysqli_error());
echo "<h1>$data<h1>"; //<-- here's where it is
if(empty($data)) {
echo '<h1>Sorry, that username is unregistered.</h1>';
}
I even tried a SELECT * FROM login_data; statement similar to that one, which should show the whole table, but I couldn't get anything. The or die in the mysqli_connect statement should show up an error if there's a problem, which there's not. All of this means there is most likely a typo somewhere, so, like so many problems, the answer should be completely obvious. I'd just like it to be obvious to me, too.