mam skrypt php ktory rejestruje mi delikwenta w bazie MySQL. jeśli gosc zaznaczy pole wyboru checkbox to chce aby mi adres email wpisal rowniez do drugiej tabeli. jesli robie wszystko dzial jesli gosc nie zaznaczy pola wyboru dane zostaja zapisane do tabeli users jesli zaznaczy to zapisuje email do tabeli newsletter ale nie users gdzie rowniez powinien!!!!
co zrobić. skrypt napisałem w ten sposób....
if (($row_duplicate['no_of_records']) != "0") {
// echo ("This email address is already present in our database. Please check you entered the correct address. If you have, you may have already registered and do not need to register again.");
echo ("<meta http-equiv=refresh content=0;url=register_all.php?&email=" . $email . "&classid=" . $classid . "&type=" . $type . "&errorcode=1>");
exit();
} else
{ // Register new user
$sql = "insert into users set
fullname='$fullname',
company='$company',
email='$email',
country='$country',
postcode='$postcode' ,
date=curdate()";
if ($pole=="on")
{
$sql = "insert into newsletter set
email='$email',
date=curdate()";
}
if (@mysql_query($sql))
{
// echo("Thank you for registering");
// echo($pageid);
// echo($title);
setcookie('solartronmobreydownloads',$email,time()+3600*24*365);
echo ("<meta http-equiv=refresh content=0;url=view_all.php?classid=" . $classid . "&type=" . $type . ">");
} else
{
echo ("Error registering user: " . mysql-error());
}
}