我是 PHP 和 MySQL 的新手,我编写了下面的代码,以启用批量短信发送,其中电话号码被选择用于数据库,电话号码位于不同的表格中,使用表格选择它们但无法发送群发短信的任何帮助将不胜感激。
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("demo_forum", $con);
if($result = mysql_query("SELECT phn_number FROM gen");
($row = mysql_fetch_array($result))
elseif ($result = mysql_query("SELECT phn_number FROM tec");
($row = mysql_fetch_array($result))
elseif ($result = mysql_query("SELECT phn_number FROM news");
($row = mysql_fetch_array($result))
elseif ($result = mysql_query("SELECT phn_number FROM pol");
($row = mysql_fetch_array($result))
else ($result = mysql_query("SELECT phn_number FROM pol, gen, news, tec");
($row = mysql_fetch_array($result))
function sendSmsMessage($phn_number, $message)
{
$ch= curl_init();curl_setopt($ch, "http://$gw_host/process_sm/sendsms.php?to=$phn_numbermessage=.urlencode($message");
curl_exec($ch);
curl_close($ch);
}