i need query
-
i have username and password fields in my table, i jus want to write a query to check whether the given details of user matches with the database. please gimme the query:confused:
-
i have username and password fields in my table, i jus want to write a query to check whether the given details of user matches with the database. please gimme the query:confused:
Something like (this may not be the best way, but a quick answer to say the least): SELECT * FROM <TABLENAME> WHERE USER = 'JOHN' AND PASS = 'MYPASS' Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's :bob: :)Programm3r My Blog: ^_^
-
Something like (this may not be the best way, but a quick answer to say the least): SELECT * FROM <TABLENAME> WHERE USER = 'JOHN' AND PASS = 'MYPASS' Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's :bob: :)Programm3r My Blog: ^_^
not like that........ wat i mean to say is....... i have alogin page where user enters his/her username and password i have to check the data with database and redirect the user to corresponding next page for the i need a query.:doh:
-
not like that........ wat i mean to say is....... i have alogin page where user enters his/her username and password i have to check the data with database and redirect the user to corresponding next page for the i need a query.:doh:
bhattiprolu wrote:
i have to check the data with database and redirect the user to corresponding next page for the i need a query
I cant see what the problem is, because after the select statement you will have all data specific to that user, so redirecting the user to the correct page should be a breeze. Just pass the information of the user to the next page. Unless I'm totlally mis-understanding you. Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's :bob: :)Programm3r My Blog: ^_^
-
not like that........ wat i mean to say is....... i have alogin page where user enters his/her username and password i have to check the data with database and redirect the user to corresponding next page for the i need a query.:doh:
bhattiprolu wrote:
not like that........
Your original post said:
i have username and password fields in my table, i jus want to write a query to check whether the given details of user matches with the database. please gimme the query
What other answer could you expect from that?!
bhattiprolu wrote:
i have to check the data with database and redirect the user to corresponding next page for the i need a query.
You mentioned nothing about login pages or redirecting users. How were we supposed to know, especially since you posted this in the "SQL" forum? If you've got the data and youre question is about ASP.NET post in the appropriate forum.
-- Always write code as if the maintenance programmer were an axe murderer who knows where you live. Upcoming FREE developer events: * Glasgow: Agile in the Enterprise Vs. ISVs, Mock Objects, SQL Server CLR Integration, Reporting Services, db4o ... * Reading: SQL Bits My website
-
bhattiprolu wrote:
i have to check the data with database and redirect the user to corresponding next page for the i need a query
I cant see what the problem is, because after the select statement you will have all data specific to that user, so redirecting the user to the correct page should be a breeze. Just pass the information of the user to the next page. Unless I'm totlally mis-understanding you. Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's :bob: :)Programm3r My Blog: ^_^
can u gimme the query.....
-
can u gimme the query.....
HE DID!! He gave you this:
SELECT * FROM <TABLENAME> WHERE USER = 'JOHN' AND PASS = 'MYPASS'
But since you've told us nothing about your database structure it may not be correct. If you want more help you'll have to help us understand your problem. Repeating the same statements over and over again do not help. You need to give us more information.
-- Always write code as if the maintenance programmer were an axe murderer who knows where you live. Upcoming FREE developer events: * Glasgow: Agile in the Enterprise Vs. ISVs, Mock Objects, SQL Server CLR Integration, Reporting Services, db4o ... * Reading: SQL Bits My website
-
i have username and password fields in my table, i jus want to write a query to check whether the given details of user matches with the database. please gimme the query:confused:
SELECT * FROM WHERE USER = 'JOHN' AND PASS = 'MYPASS' this is the write query... now if u r using c# or vb.net get result of this query in datareader and dataadaptor.. if any row returns that means username and password is correct... then redirect to the other page..
-
i have username and password fields in my table, i jus want to write a query to check whether the given details of user matches with the database. please gimme the query:confused:
They Already gave u the right Query..if u're try to implement that query in your apps just change the where value, ex :
Select * From [my_table] WHERE username = '" +UserText.Text+ "' AND password = '" +PasswdText.Text+ "'
wat else do u need they gave u the right query u need:-DRegards, Tomi
-
They Already gave u the right Query..if u're try to implement that query in your apps just change the where value, ex :
Select * From [my_table] WHERE username = '" +UserText.Text+ "' AND password = '" +PasswdText.Text+ "'
wat else do u need they gave u the right query u need:-DRegards, Tomi
TomiEdy wrote:
Select * From [my_table] WHERE username = '" +UserText.Text+ "' AND password = '" +PasswdText.Text+ "'
Then get ready for a SQL Injection Attack with code like that! Please read: SQL Injection Attacks and Tips on How to Prevent Them[^]
-- Always write code as if the maintenance programmer were an axe murderer who knows where you live. Upcoming FREE developer events: * Glasgow: Agile in the Enterprise Vs. ISVs, Mock Objects, SQL Server CLR Integration, Reporting Services, db4o ... * Reading: SQL Bits My website