A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
This is the query.
CREATE VIEW consolidate_users AS select ContactID,username,password,active,1 as user_type,ContactName as ExtraInfo from Contact union select NULL as ContactID,username,password,active,2 as user_type,CompanyName as ExtraInfo from Client union select NULL as ContactID,a.login as username,a.password,a.active,3 as user_type, b.description as ExtraInfo from EndUser a inner join UserType b on a.UserTypeID=b.UserTypeID;
Thanks and regards, ~Ray
"SELECT UserID,username,user_type,ExtraInfo FROM consolidate_users WHERE active=1 and username='".$login_name."' and password='".$login_pw."'"