-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemails.php
54 lines (44 loc) · 1.06 KB
/
emails.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
//require_once(dirname(__FILE__) . '/../libs/config.main.php');
define('LL_DB_HOST', 'sql.life-link.org');
define('LL_DB_USER', 'lifelink_basic');
define('LL_DB_PASS', '');
define('LL_DB_SCHEMA', 'lifelink');
$link = mysql_connect(LL_DB_HOST, LL_DB_USER, LL_DB_PASS);
mysql_select_db(LL_DB_SCHEMA, $link);
$result = mysql_query('SELECT email, email_contact_senior, email_contact_junior FROM member_schools');
$emails = array();
while ($row = mysql_fetch_assoc($result)) {
$em = explode(',', $row['email']);
foreach ($em as $e) {
$e = trim($e);
if ($e) $emails[] = $e;
}
$em = explode(',', $row['email_contact_senior']);
foreach ($em as $e) {
$e = trim($e);
if ($e) $emails[] = $e;
}
$em = explode(',', $row['email_contact_junior']);
foreach ($em as $e) {
$e = trim($e);
if ($e) $emails[] = $e;
}
}
$emails = array_unique($emails);
?>
<h1>Life-Link Schools' E-mail Addresses</h1>
<?
$i = 0;
foreach ($emails as $e) {
$i++;
echo $e;
if ($i == 400) {
$i == 0;
echo '<br><br>-- 400 limit --<br><br>';
}else{
echo ', ';
}
}
mysql_close($link);
?>