I'm trying to develop a PHP script that notifies premium members of changes made to certain features of my website but I'm not sure how to add the multiple records to the notifications table. What I have is:
$get_pro_sql = "SELECT id FROM members WHERE pro = '1'";
$get_pro_res = mysqli_query($con, $get_pro_sql);
while($row = mysqli_fetch_assoc($get_pro_res){
$memberid = $row["id"];
}
$message = "My New Message";
foreach($row){
$insert_note_sql = "INSERT INTO notes(id, recipient, message, ..., ...) VALUES('', 'Member_Id__Returned_From_Previous_Query', '$message')";
$insert_note_res = mysqli_query($con, $insert_note_sql);
// Inserts 5 Records
Any ideas on how this can be achieved?