/    Sign up×
Community /Pin to ProfileBookmark

Set up login to read from 2 databases?

I need to enable my login function to read data from 2 different tables in my database, the discussion forum table and the customer table. Right now, visitors can only login as customers because the login function is setup to read from the customer table, and not both of the tables.

I had a few website developers do the site for me, so I have tried to learn some javascript tutorials; I have learned the basics, but I cannot seem to figure out how to do this. I think it has to do with an “or” function or “if, then” statement.

How can I set it up so that the username and password can be read from either of the tables?

The current setup is listed below:

<%
success=2

if request(“logout”)<>”logout” then
rs.open “Select * from tblusers where username ='” & request(“txtUsername”) & “‘ and userpassword='” & request(“txtPassword”) & “‘”,con,1,3
‘rs.open “Select *
from tblusers where username ='” & request(“txtUsername”) & “‘ and userpassword='” & request(“txtPassword”) & “‘”,con,1,3
‘response.write “Select * from tblusers where username ='” & request(“txtUsername”) & “‘ and userpassword='” & request(“txtPassword”) & “‘ and userdate=” or userdate<=’#” & date() & “#'”
‘response.end
if not(rs.eof or rs.bof) then
success=1
session(“userid”)=rs(“userid”)
session(“username”)=rs(“username”)
session(“fpswd”)= request(“txtPassword”)
response.redirect “welcome.asp”
Else
session(“username”)=””
success=0
Call ClearCookies()
session.Abandon()
End if
rs.close
End if
%>

How can I make th login function read from tblForum_Members, under the columns M_username and M_password?

Thank you,

Jerome

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@ExuroMar 09.2006 — This is a question for the ASP forum, not JavaScript...
×

Success!

Help @jeromechiaro spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.1,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...