|
Revision 1, 0.8 KB
(checked in by anonymous, 7 years ago)
|
|
initial import
|
| Line | |
|---|
| 1 | #!/usr/bin/php |
|---|
| 2 | <? |
|---|
| 3 | include ('../includes/includes.inc.php'); |
|---|
| 4 | $db =& DB::connect($dsn); |
|---|
| 5 | if (DB::isError($db)) |
|---|
| 6 | error_log($_SERVER['HTTP_HOST'].' | '.__FILE__.' | Connexion SQL impossible : '.$db->getMessage()); |
|---|
| 7 | |
|---|
| 8 | $db->setFetchMode(DB_FETCHMODE_ASSOC); |
|---|
| 9 | |
|---|
| 10 | $user_r = $db->query('SELECT user.id as id, user.fname as fname, user.lname as lname, user_contact.email as email FROM user LEFT JOIN user_contact USING (id) WHERE user.status=?', array('waiting')); |
|---|
| 11 | while($user = $user_r->fetchRow()) |
|---|
| 12 | { |
|---|
| 13 | print $user['fname'].' '.$user['lname'].' '.$user['email']."\n"; |
|---|
| 14 | $todo_values = array( |
|---|
| 15 | 'robot' => 'from_sonet', |
|---|
| 16 | 'param' => 'email='.$user['email'], |
|---|
| 17 | 'etat' => 'todo', |
|---|
| 18 | 'md5' => $user['id'] |
|---|
| 19 | ); |
|---|
| 20 | $db->autoExecute('todo', $todo_values); |
|---|
| 21 | } |
|---|
| 22 | |
|---|
| 23 | $db->disconnect(); |
|---|
| 24 | ?> |
|---|