SunQuest
 
           General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old April 6th, 2003, 06:52 AM
ifistos ifistos is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 4 ifistos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question check existing username in database

please any1 can help with this? i am trying to check if the username already exist in the databse, and if so tell the user to choose another, but i get this error:Parse error: parse error in reg_form.php on line "if (mysql_num_rows($sql_username_result > 0)"


PHP Code:
 $db mysql_pconnect("$dbhostname","$dbusername","$dbpass") or die ("error connecting to database.");
mysql_select_db("$dbdatabase",$db) or die ("could not select the databse");
$sql_username_result mysql_query("SELECT * FROM users WHERE username='$username'");// or die ("$query_username". mysql_error());
if (!$sql_username_result){
    echo 
"could not exevute the query";
    }
    
if (
mysql_num_rows($sql_username_result 0){
    echo 
"username taken";
    } 

Reply With Quote
  #2  
Old April 6th, 2003, 08:03 AM
Kriek Kriek is offline
Integer Doctor
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Florida
Posts: 21 Kriek User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Kriek Send a message via AIM to Kriek Send a message via Yahoo to Kriek
PHP Code:
if (mysql_num_rows($sql_username_result 0)) { 

Reply With Quote
  #3  
Old April 6th, 2003, 08:36 AM
ifistos ifistos is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 4 ifistos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
still does not work

thanks , i corrected that but still does not work. i ve got thismessage Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in reg_form2.php on line mysql_num_rows
i believe it is something to do with mysql_num_rows but i can not find what
cheers

Reply With Quote
  #4  
Old April 6th, 2003, 11:49 AM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Try this:

PHP Code:
if (mysql_num_rows($sql_username_result) > 0){ 


That should fix your problem...
__________________
____________________________________________
Developer Shed Weekly Writer | DevArticles Forum Moderator
Build Your Own KlipFolio Klip With PHP
FrankManno.com - Under Construction
Design Interactive Group - Under Construction

Reply With Quote
  #5  
Old April 6th, 2003, 04:38 PM
ifistos ifistos is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 4 ifistos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs up thanks

thanks people!!
i got it working!
cheers

Reply With Quote
  #6  
Old April 13th, 2003, 02:09 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Was it something other than what we advised? If so, would you mind letting us know... I'm curious to know what it was.

Reply With Quote
  #7  
Old April 15th, 2003, 07:14 AM
ifistos ifistos is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 4 ifistos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
hi

yeah.... sorryy for not postin before.
to be honest it was a wierd error i vave not got for ages.....but as normally happens it was just a silly mistake , too many hour staring at the screen and too little coffee.
it was a sitnax error.... i close the if staement ( extra.
that was it......
thanks again

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > check existing username in database


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 4 hosted by Hostway