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); $result = db_query($q);
if ($result['rows'] > 0) { if ($result['rows'] > 0) {
while ($row = db_array($result['result'])) { while ($row = db_assoc($result['result'])) {
$recipients[] = $row[0]; $recipients[] = $row['username'];
} }
} }

@ -220,7 +220,7 @@ if ($result['rows'] > 0) {
$delimiter = preg_quote($CONF['recipient_delimiter'], "/"); $delimiter = preg_quote($CONF['recipient_delimiter'], "/");
$goto_single_rec_del = ""; $goto_single_rec_del = "";
while ($row = db_array($result['result'])) { while ($row = db_assoc($result['result'])) {
if ($display_mailbox_aliases) { if ($display_mailbox_aliases) {
$goto_split = explode(",", $row['goto']); $goto_split = explode(",", $row['goto']);
$row['goto_mailbox'] = 0; $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'"); $result = db_query("SELECT username FROM " . table_by_key('domain_admins') . " where domain='ALL'");
if ($result['rows'] > 0) { if ($result['rows'] > 0) {
while ($row = db_array($result['result'])) { while ($row = db_assoc($result['result'])) {
printdebug("Setting superadmin flag for " . $row['username']); printdebug("Setting superadmin flag for " . $row['username']);
db_update('admin', 'username', $row['username'], array('superadmin' => db_get_boolean(true))); db_update('admin', 'username', $row['username'], array('superadmin' => db_get_boolean(true)));
} }

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

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

Loading…
Cancel
Save