| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Senior Member Join Date: Jun 2004 Location: Ontario , Canada
Posts: 1,103
![]() ![]() ![]() | 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 |
| |
| | #2 (permalink) |
| Senior Member Join Date: Jul 2004 Location: Kizmiaz
Posts: 1,088
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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
__________________ 1 Cent Web Hosting @ Online HostGatorVoucher.com Adsense Hack for Vbulletin - Fully 3.6 Compatible ForexArea.com Free E-Course in Programming EA's |
| |
| | THREAD STARTER #3 (permalink) |
| Senior Member Join Date: Jun 2004 Location: Ontario , Canada
Posts: 1,103
![]() ![]() ![]() | 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 |
| |
| | #4 (permalink) |
| Senior Member Join Date: Jul 2004 Location: Kizmiaz
Posts: 1,088
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Choose any just to test it, say 10, maybe? Lux
__________________ 1 Cent Web Hosting @ Online HostGatorVoucher.com Adsense Hack for Vbulletin - Fully 3.6 Compatible ForexArea.com Free E-Course in Programming EA's |
| |
| | THREAD STARTER #5 (permalink) |
| Senior Member Join Date: Jun 2004 Location: Ontario , Canada
Posts: 1,103
![]() ![]() ![]() | 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 |
| |
| | #6 (permalink) |
| Senior Member Join Date: Jul 2004 Location: Kizmiaz
Posts: 1,088
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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 luckLux
__________________ 1 Cent Web Hosting @ Online HostGatorVoucher.com Adsense Hack for Vbulletin - Fully 3.6 Compatible ForexArea.com Free E-Course in Programming EA's |
| |
| | #7 (permalink) |
| NamePros Admin ![]() ![]() ![]() Join Date: Feb 2003
Posts: 12,919
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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 |
| |
| | #8 (permalink) |
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,074
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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 |
| |
| | THREAD STARTER #9 (permalink) |
| Senior Member Join Date: Jun 2004 Location: Ontario , Canada
Posts: 1,103
![]() ![]() ![]() | $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 |
| |