w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Login page database connection

There are two issues in your query...

  1. $uname is string. You must quote it.
  2. You are using ==. You are mixing PHP and mysql. Use = instead.

Update your query...

$result=mysql_query("select user.fname,password.pwd from
user,password where 
    user.uid=password.uid and user.fname='$uname'"); 

you also need to use mysqli_* or PDO; mysql_* functions are deprecated. On top of that, you have SQL injection vulnerability, so please do not use this code in production!

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.