View Single Post
Scone
Senior Member
Join Date: Apr 2010
Location: England
Old 04-12-2010 , 16:57   Re: Signal PM System - MySQL based in-game Private Messaging
Reply With Quote #12

If you add a table "signal_emails", the following (entirely untested) code could work:

PHP Code:
$db mysql_connect(...);

$q mysql_query("SELECT DISTINCT email FROM signal, signal_emails "
                 
"WHERE unread = 1 AND destId = signal_emails.steamId"$db);

$rows mysql_num_rows($q);

for(
$i 0$i $rows$i++) {
    
$res mysql_fetch_array($q);
    
mail($res[0], "Unread PM""You have one or more unread PMs in your inbox!");
}

mysql_close($db); 
__________________

Last edited by Scone; 04-14-2010 at 05:36. Reason: typo
Scone is offline