So, I'm writing an application in PHP and I'm trying to retrieve unique user data based on what they entered. Here is my code:
function hello($username123) {
// Connect to Database //
$host3 = "db";
$username3 = "db";
$password3 = "db";
$db3 = "db";
$con3 = mysqli_connect($host3,$username3,$password3,$db3) or die("Can not connect to Server.");
$student1name;
$query3 = mysqli_query($con3,"SELECT * FROM 'users' WHERE 'username' = '$username123' and '$student1name' = 'student1'");
return "$student1name";
}
So, the user enters there username which they registered earlier on and then I run a query where the username field is equal to the username variable (The input) and that the student1name variable is equal to the student1 field where the username is the same as the one entered. I then return the student1name variable. But when I test this all that returns is "". I can't figure out the problem