gpt4 book ai didi

带有来自两个表的地址的 PHP MYSQL 通讯

转载 作者:行者123 更新时间:2023-11-30 23:11:23 26 4
gpt4 key购买 nike

您好,我有新问题 :) 我正在构建带有面板的简单时事通讯,以向注册用户和时事通讯邮件地址发送邮件。

我有此代码,但时事通讯仅发送给注册用户。谁能告诉我为什么?

    $zapytanie = mysql_query("SELECT login, imie, email FROM uzytkownicy UNION SELECT email,imie,login FROM newsletter");


while($wynik=mysql_fetch_array ($zapytanie)) {


$login2 = $wynik['login'];

$imie = $wynik['imie'];

$serwis_url = $zmienne['serwis_url'];

$email = $wynik['email'];



$tresc = '<!DOCTYPE HTML PUBLIC "-//W3C//Dtd HTML 4.0 transitional//EN">

<html><head><meta http-equiv="Content-type" content="text/html; charset=utf-8"></head>

<body bgcolor="#ffffff"><font face="Arial" style="font-size:13px;" color="#3E3E3E">'.nl2br(($wiadomosc)).'</font></BODY></HTML>';


$headers = 'Reply-To: '.$zmienne['admin_email'].' <'.$zmienne['admin_email']."> \r\n";
$headers .= 'From: "Administrator" <'.$zmienne['admin_email'].">\r\n";
$headers .= "MIME-Version: 1.0 \r\n";
$headers .= "Content-type: text/html; charset=utf-8 \r\n";

$headers = 'Reply-To: '.$zmienne['admin_email'].' <'.$zmienne['admin_email']."> \r\n";
$headers .= 'From: "Administrator" <'.$zmienne['admin_email'].">\r\n";
$headers .= "MIME-Version: 1.0 \r\n";
$headers .= "Content-type: text/html; charset=utf-8 \r\n";
$headers = iconv("UTF-8","ISO-8859-2", $headers);


$tresc = strtr($tresc, "\xA5\x8C\x8F\xB9\x9C\x9F", "\xA1\xA6\xAC\xB1\xB6\xBC");

$tresc = str_replace("{login}",$login2,$tresc);

$tresc = str_replace("{imie}",$imie,$tresc);

$tresc = str_replace("{serwis_url}",$serwis_url,$tresc);

$temat = str_replace("{login}",$login2,$temat);

$temat = str_replace("{imie}",$imie,$temat);

$temat = str_replace("{serwis_url}",$serwis_url,$temat);



mail($email, $temat, $tresc, $headers);


}


}

最佳答案

您的联合选择中的列顺序必须相同:

$zapytanie = mysql_query("SELECT login, imie, email FROM uzytkownicy UNION SELECT login, imie, email FROM newsletter");

关于带有来自两个表的地址的 PHP MYSQL 通讯,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19585503/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com