Bu hatayı veriyor. (Eğer SQL sözdizimi bir hata var; line 1 '@ myemail.net yakınındaki kullanılacak doğru sözdizimi için MySQL sunucu sürümü karşılık kılavuzunu kontrol)
$user_id = $_SESSION['user_id'];
$emails = $_REQUEST['emails'];
$subject = "Invitation from $email";
$headers = 'From: '.$email;
$emails = $_REQUEST['emails'];
foreach ($emails as $to) {
list($to,$name) = split(':::',$to,2);
$message = "Hi $name, $email would like you to take a look at this site! http://www.lunarsys.com\r\n\r\n";
mail($to, $subject, $message, $headers);
echo "Mail sent to $name ($to)<br/>\r\n";
$query = "SELECT j_user_id FROM jt_members_external_contacts WHERE j_user_id = $user_id AND contact_email = $to;";
$result = mysql_query($query) or die(mysql_error());
$conrows = mysql_num_rows($result);
if($conrows > 0)
{
echo "Exist";
}else
{
//
//Insert News into Articles Database
$sql_insert = "INSERT into `jt_members_external_contacts`
(`j_user_id`,`contact_email`,`firstname`
)
VALUES
('$user_id','$to','$name'
)
";
mysql_query($sql_insert) or die(header("Location: /error_page?error_msg=1"));
}