php - 如何使用 PHP 向多个用户发送消息

标签 php html css

我正在使用 PHP 消息系统在用户之间发送消息。但我的问题是,如何在 new_pm.php 中向多个用户发送消息。

http://www.webestools.com/scripts_tutorials-code-source-15-personal-message-system-in-php-mysql-pm-system-private-message-discussion.html

$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/

相关文章:

java - 从本地文件在 JEditorPane 中设置背景图像

php - 将本地 mysql 数据库与远程 MySQL 数据库连接

php - 测验表字段的索引基数是 '2' ,但应该是 '0'

html - 如何在 Chrome 中调整纯 flexbox masonry 网格,它已经在 Firefox 中运行

html - 内部元素不延伸父高度元素

css - 中心 '+' 在 border-radius 50% div 内?

html - 将鼠标悬停在图像上会在图像旁边显示文本

javascript - 使用 Ajax 和 PHP 的 HTML 表单无法正常工作

php - 查找最常见的数字范围

javascript - 动态背景滚动