我正在使用 PHP 消息系统在用户之间发送消息。但我的问题是,如何在 new_pm.php 中向多个用户发送消息。
$dn1 = mysqli_fetch_array($conn->query('select count(id) as recip, id as
recipid, (select count(*) from pm) as npm from registrationform where
email="'.$recip.'" '));
if($conn->query('insert into pm (id, id2, title, user1, user2, message,
timestamp, user1read, user2read)values("'.$id.'", "1", "'.$title.'",
"'.$id1.'", "'.$dn1['recipid'].'", "'.$message.'", "'.time().'", "yes",
"no")'))
最佳答案
伪代码:
作为用户foreach user2array
执行插入查询,但对于 user2 列,将值替换为收件人用户 ID。
我不确定 id2 列是什么。或许你能想出办法。
关于php - 如何使用 PHP 向多个用户发送消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43405591/