Ario Rakip Ario Rakip - 8 months ago 45
MySQL Question

Unable to retrieve data from MYSQL Database in PHP

I am trying to retrieve the password of a user, when given the email.

$query = "SELECT password FROM `users` WHERE email='$username'";
$result = mysqli_query($query);
echo $row;

But it does not seem to work. Can anyone figure what's the problem?

Thanks in advance.


You Need To Connect To Your Database

$connection = new mysqli('Host Name', 'Username', 'password', 'Database Name', 'port(Optional)');

Second mysqli_query($query); Should Be mysqli_query($connection, $query);

Third $row Is An Array To Echo A Database Value Use $row['column']