TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 06-12-2012, 09:42 PM   #1 (permalink)
The Visitor
 
Join Date: Jun 2012
Posts: 2
Thanks: 1
rios2 is on a distinguished road
Default mysql_num_rows(): supplied argument is not a valid MySQL result resource

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/9152261/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
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!
rios2 is offline  
Reply With Quote
 



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

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mysql_num_rows(): supplied argument is not a valid MySQL result resource Calus Absolute Beginners 6 01-29-2013 11:33 AM
Warning: fread(): supplied argument is not a valid stream resource sarmenhb General 7 04-23-2008 08:48 AM
Securing your MySQL Queries with Sprintf Wildhoney General 26 03-18-2008 06:52 PM


All times are GMT. The time now is 04:09 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design