can u help me to make it disaply..USER if user login which is having type 0 and ADMN id admn login whose type is 1 in onlinetestusers table
select * from onlinetestusers;
uid | username | password | name | type
--------+----------+----------+-------------------+------
on1001 | harman | preet | harmanpreet singh | 0
on1002 | antonio | magdic | antonio | 1
0 is user
i is admn
<?php
$username = $POST["username"];
$password = $POST["password"];
$connection = pg_connect("dbname=harmantest user=damdev host=localhost ");
echo $connection;
if (!$connection)
{
print("Connection Failed ");
exit;
}
$result = pg_query($connection, "select * from onlinetestusers where username='$username' and password='$password' ");
echo $result;
while($row = pg_fetch_row ($result))
{
$username = $row['username'];
$password = $row['password'];
}
if ($username == $result['username'] && $password == $result['password'])
{
print "The entered username and password were correct!";
}
else
{
print "The entered username and password were wrong!";
}
?>