I am using PHP Messaging system to send messages between user's. But my question was, how to send messages to multiple user's in 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")'))
Pseudocode:
foreach user2array as user
do your insert query but for user2 column, replace the value with the recipient user id.
What is the id2 column I'm not sure. Maybe you can figure out.