MySQL
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Tutorialized ForumsDatabasesMySQL

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old March 4th, 2008, 09:34 AM
yoyo888 yoyo888 is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 2 yoyo888 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 52 sec
Reputation Power: 0
Error in php/MySQL query?

Hello,
I have this query to find out whether the email address the user typed in, already exists in the database.

if($res=mysql_query("SELECT address FROM email WHERE address ='{$new_emailaddress}'") <>FALSE) {
echo "This email address already exists . Enter a new one.";}


the problem is, the query always returns true. But I want to compare it to the email address the user enters.

Can anyone help me?

Reply With Quote
  #2  
Old March 13th, 2008, 12:05 PM
mwasif mwasif is offline
Contributing User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Saudi Arabia
Posts: 7 mwasif User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 m 35 sec
Reputation Power: 0
I am assuming user provided email is in $new_emailaddress.
PHP Code:
 $res=mysql_query("SELECT address FROM email WHERE address ='$new_emailaddress'");
if(
mysql_num_rows($res)>0){
echo 
"This email address already exists . Enter a new one.";


Reply With Quote
Reply

Viewing: Tutorialized ForumsDatabasesMySQL > Error in php/MySQL query?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT