PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingPHP Development

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:
  #1  
Old June 12th, 2012, 06:49 PM
rios2 rios2 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 2 rios2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 51 sec
Reputation Power: 0
Mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/con

Hey guys,
I was working through the tutorial on creating registration page. On Activation PHP went through the coding error:
Mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/content/68/9152262/html/activation.php on line 16.

Tried different variation nothing works... so frustrated. I thought professional opinion would help to find a problem. Please help!!! Here is the code:

PHP Code:
<?php 
if($_GET['id']!=""){
include_once 
"connect_to_mysql.php";

$id $_GET['id'];
$hashpass $_GET['sequence']; 

$id mysql_real_escape_string($id);
$id eregi_replace("`"""$id); 

$hashpass mysql_real_escape_string($hashpass);
$hashpass eregi_replace("`""",$hashpass);

$sql mysql_query("UPDATE members SET email_activated='1' WHERE id='$id' AND password='$hashpass'");
$sql_doublecheck mysql_query("SELECT * FROM members WHERE id='$id' AND password='$hashpass' AND email_activated='1'");
$doublecheck mysql_num_rows($sql_doublecheck);

if(
$doublecheck == 0){
$msgToNewMember "</br></br><h3><strong><font color=red>Your account could not be activated</font></strong></h3><br/>
Please contact us regarding your activation via email"
;
include 
'msgToNewMember.php';
exit();
} else if(
$doublecheck>0) {
$msgToNewMember "<br/><br/><strong><font color=\"#0066CC\">You successfully activated your account!<br/>
Now you can login to your account.</font></strong><h3>"
;
include 
'msgToNewMember.php';
exit();

}

print 
"Essential part from activation link is missing! Please copy full activation link that was supplied in our email to you and paste it in a new browser address bar. Thank you!
</br>
"
;

?>


Thank you very much!

Moderator's Note: PHP tags added by Nilpo.

Reply With Quote
  #2  
Old June 13th, 2012, 12:35 PM
juacala juacala is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 5 juacala User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 55 m 42 sec
Reputation Power: 0
My guess is that your link is bad, so the query never actually runs, or you have an error in your SQL. You should check the error state of the query after you run it.

Right after the query (before you run mysql_num_rows), run:

echo mysql_error();

That should tell you what the problem was.

Reply With Quote
  #3  
Old June 15th, 2012, 12:17 AM
rios2 rios2 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 2 rios2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 51 sec
Reputation Power: 0
Thank you!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/con


Developer Shed Advertisers and Affiliates


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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap