Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Data camparison proble in mysql
Old 06-30-2005, 09:47 AM Data camparison proble in mysql
bman's Avatar
Skilled Talker

Posts: 85
Location: USA
Trades: 0
Question,

I am attempting to check for if user has registered before, by comparing the email at login with the one in the db. The process below works, but I found a problem. If the case of the input is different, the db registers it as a new user. (example: anyone@this.com, and Anyone@this.com, or anyOne@this.com) are accepted as different users. How can I get my code to do and exact comparison, without the case sensitivity?

This is what I have now:

Code:
$abs = mysql_fetch_array($rs) ;

while($result = mysql_fetch_array($rs))
		{
if($result['email'] == $mail)
	{
		header("location: freesignup2.htm"); exit();
	}
}
bman is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-30-2005, 10:16 AM
0beron's Avatar
Defies a Status

Posts: 1,832
Location: Somewhere else entirely
Trades: 0
You can convert both strings into lower case using strtolower() and then compare the lower case versions:

PHP Code:
$abs mysql_fetch_array($rs) ;

while(
$result mysql_fetch_array($rs))
        {
if(
strtolower($result['email']) == strtolower($mail))
    {
        
header("location: freesignup2.htm"); exit();
    }

__________________
UPDATE 0beron SET talkupation = talkupation + lots WHERE post = 'helpful';

Please login or register to view this content. Registration is FREE
(aka MSN handwriting for forums)
0beron is offline
Reply With Quote
View Public Profile Visit 0beron's homepage!
 
Old 06-30-2005, 11:27 AM
bman's Avatar
Skilled Talker

Posts: 85
Location: USA
Trades: 0
It still seeing the difference and lording it into the db.
bman is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Data camparison proble in mysql
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.33086 seconds with 12 queries