NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Need Help fixing an error on 1 line

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 02-15-2005, 03:27 PM THREAD STARTER               #1 (permalink)
Senior Member
Join Date: Jun 2004
Location: Ontario , Canada
Posts: 1,103
Mike_Wiseman is a jewel in the roughMike_Wiseman is a jewel in the roughMike_Wiseman is a jewel in the rough
 



Need Help fixing an error on 1 line


hi everybody, im trying to get my usersystem to work but it is screwing up, when you enter the activation code, username and email and click activate i get this error:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/mwise/public_html/usersystem/members/activate.php on line 31

This is line 31:
$rowCount = mysql_num_rows($rsChk);

what is wrong in that line?
thnx
__________________
"Dont argue with an idiot, he will just drag you down to his level and beat you with expeirence. Dont argue with me, ill drag you down to my level and beat you with a baseball bat"
:D
Mike_Wiseman is offline  
Old 02-15-2005, 04:35 PM   #2 (permalink)
Senior Member
 
luxinterior's Avatar
Join Date: Jul 2004
Location: Kizmiaz
Posts: 1,088
luxinterior is a glorious beacon of lightluxinterior is a glorious beacon of lightluxinterior is a glorious beacon of lightluxinterior is a glorious beacon of lightluxinterior is a glorious beacon of lightluxinterior is a glorious beacon of lightluxinterior is a glorious beacon of lightluxinterior is a glorious beacon of light
 



Try changing $rsChk to a fixed number and see if it runs. If it does then somewhere else on the page $rsChk is being set correctly.

Lux
luxinterior is offline  
Old 02-15-2005, 04:40 PM THREAD STARTER               #3 (permalink)
Senior Member
Join Date: Jun 2004
Location: Ontario , Canada
Posts: 1,103
Mike_Wiseman is a jewel in the roughMike_Wiseman is a jewel in the roughMike_Wiseman is a jewel in the rough
 



what number should i set it to?
__________________
"Dont argue with an idiot, he will just drag you down to his level and beat you with expeirence. Dont argue with me, ill drag you down to my level and beat you with a baseball bat"
:D
Mike_Wiseman is offline  
Old 02-15-2005, 04:46 PM   #4 (permalink)
Senior Member
 
luxinterior's Avatar
Join Date: Jul 2004
Location: Kizmiaz
Posts: 1,088
luxinterior is a glorious beacon of lightluxinterior is a glorious beacon of lightluxinterior is a glorious beacon of lightluxinterior is a glorious beacon of lightluxinterior is a glorious beacon of lightluxinterior is a glorious beacon of lightluxinterior is a glorious beacon of lightluxinterior is a glorious beacon of light
 



Choose any just to test it, say 10, maybe?

Lux
luxinterior is offline  
Old 02-15-2005, 04:53 PM THREAD STARTER               #5 (permalink)
Senior Member
Join Date: Jun 2004
Location: Ontario , Canada
Posts: 1,103
Mike_Wiseman is a jewel in the roughMike_Wiseman is a jewel in the roughMike_Wiseman is a jewel in the rough
 



so i pick a random number replace it, and it will work? lol sounds like im missing something?
__________________
"Dont argue with an idiot, he will just drag you down to his level and beat you with expeirence. Dont argue with me, ill drag you down to my level and beat you with a baseball bat"
:D
Mike_Wiseman is offline  
Old 02-15-2005, 05:17 PM   #6 (permalink)
Senior Member
 
luxinterior's Avatar
Join Date: Jul 2004
Location: Kizmiaz
Posts: 1,088
luxinterior is a glorious beacon of lightluxinterior is a glorious beacon of lightluxinterior is a glorious beacon of lightluxinterior is a glorious beacon of lightluxinterior is a glorious beacon of lightluxinterior is a glorious beacon of lightluxinterior is a glorious beacon of lightluxinterior is a glorious beacon of light
 



Sounds like you are Mike The idea is that line is expecting a number. You are simply going to test to see if, when it actually gets a number, it works. If it does then you've identified your problem. I believe the technical term is 'debugging' Good luck

Lux
luxinterior is offline  
Old 02-15-2005, 09:43 PM   #7 (permalink)
RJ
NamePros Admin


 
RJ's Avatar
Join Date: Feb 2003
Posts: 12,919
RJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatness
 



Find Marrow Donors! Cystic Fibrosis Parkinson's Disease
There's nothing wrong with that line. It's saying that $rsChk is not a valid MySQL result -- the mysql_num_rows() function will return the number of rows from a MySQL query but this is saying there was not a successful MySQL query.

Chances are there's a SQL syntax error in a previous line.

Look for a previous line that says something like this, and paste it here if you'd like us to check for an error. Also make sure your column names are correct and free of typos:

$rsChk = mysql_query("something");
__________________
Reach me at rj at namepros dot com
RJ is offline  
Old 02-16-2005, 02:45 AM   #8 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,074
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
yes -RJ- is absolutely correct that error is generated when the sql you are checking how many rows exist for did not execute correctly, ussually caused by errors in the SQL.

What I tend to do with things like this is echo our the query then try it in phpmyadmin and see what error they give, it will give you an idea of where in the SQl the error exists.

In my case it is ussually that I forgot to quote the values etc.
__________________
Manage your portfolio using my new Domain Portfolio Management script.
Securing Your Domain Name From Theft
Peter is offline  
Old 02-16-2005, 04:04 AM THREAD STARTER               #9 (permalink)
Senior Member
Join Date: Jun 2004
Location: Ontario , Canada
Posts: 1,103
Mike_Wiseman is a jewel in the roughMike_Wiseman is a jewel in the roughMike_Wiseman is a jewel in the rough
 



$rsChk = mysql_query($qChk);

thats it. That was the line right above it
__________________
"Dont argue with an idiot, he will just drag you down to his level and beat you with expeirence. Dont argue with me, ill drag you down to my level and beat you with a baseball bat"
:D
Mike_Wiseman is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


 
All times are GMT -7. The time now is 02:44 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger