473,378 Members | 1,427 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

how to check case for username password field in table?

nirmalsingh
218 100+
hai all,
in a table user master i have username:Admin , password:admin and userid:1

i have to retrieve user id where username='Admin' and password:'admin'

if i enter username='admin' and password:'Admin' (check case for field value)
the user id should not retrieved.
how to write a simple query for this?

thanx in advance
with Regards
Nirmal.
Feb 23 '08 #1
1 2658
jagged
23
You can do something like

Expand|Select|Wrap|Line Numbers
  1. SELECT *
  2. FROM users
  3. WHERE 
  4. BINARY_CHECKSUM(username) = BINARY_CHECKSUM('username') AND 
  5. BINARY_CHECKSUM([passwd) = BINARY_CHECKSUM('password')
  6.  
You can leave the " username = 'username' and passwd = 'password' " in the where clause to cover the *extremely* unlikely event that two different usernames and passwords (used in the same record) return the same checksum...
Feb 23 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: Cecil | last post by:
Does this make sense for a logon table: CREATE TABLE Logon ( ID INT NOT NULL IDENTITY PRIMARY KEY, name VARCHAR(15) NOT NULL, password VARCHAR(15) NOT NULL ) GO CREATE UNIQUE INDEX...
4
by: nemo | last post by:
I've included a list of username/password combinations in the Web.Config file and I've a simple .aspx page with a username and password field for the users to log in. While the password field is...
11
by: Kevin O'Brien | last post by:
Hello, I am creating a sign on screen for my application in which I want to store the username and password in a database table. I was thinking of putting a combo box connected to the database...
2
by: Boujii | last post by:
<html> <head> <title>Add New MySQL User</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <? if(isset($_POST)) {
2
by: deepika1 | last post by:
hi , i wrote a code for to delete the particular rows in a table using check boxes.But in that i select the particular rows and click on the delete button these rows didn't delete.plz check...
2
by: Ken Fine | last post by:
I want to add the security question and answer security feature to the ChangePassword control. I am aware that this functionality is built into the PasswordRecovery tool. I have implemented the...
7
by: Dhiru1009 | last post by:
Hi guys, I need help with validating the user to see if the username exists in database table or not. Here is my code. default.php <form name="form1" action="authenticate.php">
82
by: happyse27 | last post by:
Hi All, I modified the user registration script, but not sure how to make it check for each variable in terms of preventing junk registration and invalid characters? Two codes below : a)...
3
by: PHPstarter | last post by:
Hiya. I have a script that is run by a <form> which basically allows u to write into inputs the fields username, new username, password, repeat password, comment etc, The problem is that I want...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.