Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in activation.php on line 11
Invalid Validation Code
what is wrong here?
<?php
session_start();
include "mysql.php";
$c;
if(!$_GET['code'] || !$_GET['act'])
{
die("Invalid Use Of System.");
} else {
$code=$_GET['code'];
$cq=mysql_query("select * from confirm where code=$code",$c);
if(mysql_num_rows($cq)== 0)
{ die("Invalid Validation Code"); }
$r=mysql_fetch_array($cq);
if($_GET['act'] == 'activate')
{
mysql_query("UPDATE users SET confirmed='1' WHERE userid={$r[user]}",$c);
mysql_query("DELETE FROM confirm WHERE code=$code",$c);
print "Account Validated!<br />
<a href='login.php'>Login</a>";
} else if($_GET[act] == 'cancel')
{
mysql_query("DELETE FROM users WHERE userid={$r[user]}",$c);
mysql_query("DELETE FROM confirm WHERE code=$code",$c);
print "Your account has successfully been cancelled, Were sorry you had to leave.";exit;
} else {
die("Invalid Action.");
}
}
?>