Hello gentlemen once again i have a slight issue, I got my script to automatically send me an e-mail with a confirmation link, but when it goes to confirm that account I get this error:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home2/chicagt7/public_html/confirm.php on line 11
and here is my script:
[CODE]<?php
//opens a connection to the MYSQUL
require (“dbconnect.php”);
$confirmId = $_GET[‘c’];
$errorMessage = “”;
$validCount = 0;
$query = “SELECT confirmed FROM `users` WHERE confirmationCode=’$confirmId'”;
$result = mysql_query($query);
$validCount = mysql_num_rows($result);
if($result[‘confirmed’] == 1) $errorMessage .= “You have already confirmed this account.<br/>”;
if($validCount == 0) $errorMessage .= “You are trying to confirm an invalid account.<br/>”;
if(empty($errorMessage))
{
$query = “UPDATE `users` SET confirmed = 1 WHERE confirmationCode=’$confirmId'”;
mysql_query($query) OR die(mysql_error());
echo ‘Your account has been confirmed!’;
}
else
{
echo $errorMessage;
}
?>
any help would be appreciated!