I have a error in my newsletter and I don't know what doing wrong. Please help me. Now I doing newsletter, first time I used MySQL in my code.
Here is the error:
Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 3 in subscribe.php on line 54
Here is my code:
if($mail == NULL){
}
else{
$token = sha1(time());
$result1 = @mysql_query("INSERT INTO newsletter (Address,Token) VALUES (\"".$mail."\", \"".$token."\") ");
if ($result1) {
sendmail($mail);
}
else{ /*This else */
$result2 = mysql_query("SELECT Confirmed FROM newsletter where Address = \"".$mail."\" ");
$confirm = mysql_result($result2,0);
if($confirm == "y"){
}
else if($confirm == "n"){
}
}
}
?>
What I do wrong?