Hello all,
I'm currently working on a PHP/MySQL script that does the following, in this order:
1) Checks DB for any videos that need converting 2) Once determined that a video needs to be converted, it begins to convert *3) Notifies the "creator" of video that it's been created. *4) Notifies all users who are "receivers" of the video, that they have a new video.
Note, I'm looking for help on the starred numbers above.
Here's my basic db/table structure (some parts intentionally left out, because I don't want to type them:
video_data:
id
creator_id
needs_process
video_info
id
video_id (relational to 'id' in table above).
receiver_id
tblusers
usrID
usrFirst
usrLast
usrEmail
Here's what I currently have in my script:
<?php
require("connection.php");
$rs = mysql_db_query($DBname,$sql,$link);
$data = mysql_query("SELECT * FROM video_data WHERE needs_process=1 LIMIT 1") or die(mysql_error());
while($row = mysql_fetch_array( $data ))
{
$id = $row['id'];
$sender = $row['sender_id'];
//Convert The Video Here (I've already written this code).
//Maybe Create a Thumbnail Too (I've already written this code).
}
My question is: In the code above, how would I both email the "creator" (always 1 person) and email the receivers (sometimes multiple receivers). Moreover, these would probably be "separate" or "different" emails. For example, the creator would receive an email saying "Thanks for uploading!", while the receivers would receive one saying "You've got a new video."
Any help on this would be great!