this is resolved thanks to jayant who helped me in removing the erroor..pasting the right code for ur help friends and can anyone tellme how to opt tht this thread is resolved
<?php
$username = $POST['username'];
$password = $POST['password'];
$connection = pg_connect("dbname=harmantest user=damdev host=localhost") or die("Can't connect to database server.");
//echo $connection;
$query = pg_query("SELECT type FROM onlinetestusers WHERE username='$username' AND password='$password'") or die('Cannot execute the query.');
$no_rows = pg_num_rows($query);
//echo $no_rows;
if ( $no_rows == 1 )
{
$result = pg_fetch_assoc($query);// instead of returning it as $result[0], $result[1]
//,it does it as $result['type']
if ( $result['type'] == 'user' )
{
echo ( 'User' );
}
else if ( $result['type'] == 'admin' )
{
echo ( 'Admin' );
}
else
{
echo ( 'Invalid user type.' );
}
}
else
{
echo ( 'Username or password was wrong.' );
}
?>