All pastes #878649 Raw Edit

Miscellany

public php v1 · immutable
#878649 ·published 2008-01-29 14:38 UTC
rendered paste body
function copycontacts_admin() {    // Connect to the DB    $db = mysql_connect('localhost', 'ownthesports_ems', 'ownthesports_ems');    if ($db) {        $ems = mysql_select_db('ownthesports_ems', $db);            if ($ems) {                                $query = mysql_query("SELECT * FROM ems_maillists");                                                while ($lists = mysql_fetch_object($query) ) {                    $select[$lists->MailListID] = $lists->Name;                }                print_r($select);                $form['copycontacts_mlist'] = array(                    '#type' => 'select',                    '#title' => t('Active Mailing List'),                    '#default_value' => variable_get('copycontacts_mlist', 'None'),                    '#options' => $select,                    '#description' => t("The mailing list that is assigned for names to go in to.")                );                return system_settings_form($form);            } else {                echo "Error: Cannot connect to db";            }        // Close the DB connection        mysql_close($db);       } else {        echo "Error: failed to connect to server";    }           }