I am new in programming. I actually want to check user input value with stored value in database. Specially, email and password which is given by the user, print the details of that respective email id. Here is my code. Please help me to correct my code.
<?php
$conn = mysqli_connect('localhost', 'root', '', 'mydb');
$sql = "SELECT email, first FROM register";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_assoc($result)) {
echo "Welcome " . $row["first"]. "<br>". "Your Email Id is: " . $row["email"] . "<br>";
}
} else {
echo "0 results";
}
mysqli_close($conn);
?>