move to use db_assoc() rather than db_array() (code assumes assoc. array)

pull/154/head
David Goodwin 7 years ago
parent 43a2493876
commit c147eb053b

@ -65,8 +65,8 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
}
$result = db_query($q);
if ($result['rows'] > 0) {
while ($row = db_array($result['result'])) {
$recipients[] = $row[0];
while ($row = db_assoc($result['result'])) {
$recipients[] = $row['username'];
}
}

@ -220,7 +220,7 @@ if ($result['rows'] > 0) {
$delimiter = preg_quote($CONF['recipient_delimiter'], "/");
$goto_single_rec_del = "";
while ($row = db_array($result['result'])) {
while ($row = db_assoc($result['result'])) {
if ($display_mailbox_aliases) {
$goto_split = explode(",", $row['goto']);
$row['goto_mailbox'] = 0;

@ -1405,7 +1405,7 @@ function upgrade_1284_mysql_pgsql() {
$result = db_query("SELECT username FROM " . table_by_key('domain_admins') . " where domain='ALL'");
if ($result['rows'] > 0) {
while ($row = db_array($result['result'])) {
while ($row = db_assoc($result['result'])) {
printdebug("Setting superadmin flag for " . $row['username']);
db_update('admin', 'username', $row['username'], array('superadmin' => db_get_boolean(true)));
}

@ -63,7 +63,7 @@ if ($_SERVER['REQUEST_METHOD'] === "POST") {
if ($token !== false) {
$table = table_by_key($context === 'users' ? 'mailbox' : 'admin');
$result = db_query("SELECT * FROM $table WHERE username='$tUsername'");
$row = db_array($result['result']);
$row = db_assoc($result['result']);
$email_other = trim($row['email_other']);
$phone = trim($row['phone']);

@ -68,7 +68,7 @@ if ($error != 1) {
}
$result=db_query($query);
if ($result['rows'] > 0) {
while ($row = db_array($result['result'])) {
while ($row = db_assoc($result['result'])) {
if (db_pgsql()) {
$row['timestamp']=gmstrftime('%c %Z', $row['timestamp']);
}

Loading…
Cancel
Save