aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authornikrou <nikrou@piwigo.org>2009-11-15 12:26:09 +0000
committernikrou <nikrou@piwigo.org>2009-11-15 12:26:09 +0000
commit1040cae2104259fdec8543e0a41ac63cbe24c69c (patch)
treef1a08573c7d2bdf1b8634263226fd42de7088848 /admin
parentdda7f4571b72323c4e53ce5ef4a42412b65da3bd (diff)
Feature 1241 resolved. replace mysql_fetch_array by mysql_fetch_assoc for small php code improvements
git-svn-id: http://piwigo.org/svn/trunk@4265 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/cat_modify.php4
-rw-r--r--admin/cat_perm.php10
-rw-r--r--admin/configuration.php2
-rw-r--r--admin/element_set.php2
-rw-r--r--admin/element_set_global.php2
-rw-r--r--admin/element_set_ranks.php2
-rw-r--r--admin/element_set_unit.php2
-rw-r--r--admin/group_list.php2
-rw-r--r--admin/group_perm.php6
-rw-r--r--admin/history.php6
-rw-r--r--admin/include/c13y_internal.class.php2
-rw-r--r--admin/include/functions.php44
-rw-r--r--admin/include/functions_metadata.php4
-rw-r--r--admin/include/functions_notification_by_mail.inc.php2
-rw-r--r--admin/include/functions_permalinks.php4
-rw-r--r--admin/notification_by_mail.php4
-rw-r--r--admin/picture_modify.php6
-rw-r--r--admin/rating.php4
-rw-r--r--admin/site_manager.php6
-rw-r--r--admin/site_update.php14
-rw-r--r--admin/stats.php4
-rw-r--r--admin/tags.php4
-rw-r--r--admin/upload.php4
-rw-r--r--admin/user_list.php6
-rw-r--r--admin/user_perm.php8
25 files changed, 77 insertions, 77 deletions
diff --git a/admin/cat_modify.php b/admin/cat_modify.php
index 1c740305c..1ca146aa6 100644
--- a/admin/cat_modify.php
+++ b/admin/cat_modify.php
@@ -193,7 +193,7 @@ SELECT *
FROM '.CATEGORIES_TABLE.'
WHERE id = '.$_GET['cat_id'].'
;';
-$category = mysql_fetch_array( pwg_query( $query ) );
+$category = mysql_fetch_assoc( pwg_query( $query ) );
// nullable fields
foreach (array('comment','dir','site_id', 'id_uppercat') as $nullable)
{
@@ -373,7 +373,7 @@ SELECT id,tn_ext,path
FROM '.IMAGES_TABLE.'
WHERE id = '.$category['representative_picture_id'].'
;';
- $row = mysql_fetch_array(pwg_query($query));
+ $row = mysql_fetch_assoc(pwg_query($query));
$src = get_thumbnail_url($row);
$url = get_root_url().'admin.php?page=picture_modify';
$url.= '&amp;image_id='.$category['representative_picture_id'];
diff --git a/admin/cat_perm.php b/admin/cat_perm.php
index ed0257bc4..0107d6cc7 100644
--- a/admin/cat_perm.php
+++ b/admin/cat_perm.php
@@ -45,7 +45,7 @@ SELECT status
FROM '.CATEGORIES_TABLE.'
WHERE id = '.$_GET['cat'].'
;';
- list($status) = mysql_fetch_array(pwg_query($query));
+ list($status) = mysql_fetch_row(pwg_query($query));
if ('private' == $status)
{
@@ -62,7 +62,7 @@ SELECT id
LIMIT 0,1
;';
- list($page['cat']) = mysql_fetch_array(pwg_query($query));
+ list($page['cat']) = mysql_fetch_row(pwg_query($query));
}
// +-----------------------------------------------------------------------+
@@ -110,7 +110,7 @@ SELECT group_id, cat_id
AND group_id IN ('.implode(',', $_POST['grant_groups']).')
;';
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
array_push($granteds[$row['cat_id']], $row['group_id']);
}
@@ -169,7 +169,7 @@ SELECT user_id, cat_id
AND user_id IN ('.implode(',', $_POST['grant_users']).')
;';
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
array_push($granteds[$row['cat_id']], $row['user_id']);
}
@@ -274,7 +274,7 @@ SELECT user_id, group_id
WHERE group_id IN ('.implode(',', $group_granted_ids).')
';
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
if (!isset($granted_groups[$row['group_id']]))
{
diff --git a/admin/configuration.php b/admin/configuration.php
index a0df63190..d193f9f8d 100644
--- a/admin/configuration.php
+++ b/admin/configuration.php
@@ -138,7 +138,7 @@ if (isset($_POST['submit']) and !is_adviser())
{
//echo '<pre>'; print_r($_POST); echo '</pre>';
$result = pwg_query('SELECT param FROM '.CONFIG_TABLE);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
if (isset($_POST[$row['param']]))
{
diff --git a/admin/element_set.php b/admin/element_set.php
index 821c4e188..9cbdb7eec 100644
--- a/admin/element_set.php
+++ b/admin/element_set.php
@@ -192,7 +192,7 @@ elseif ('recent'== $_GET['cat'])
$page['title'] = l10n('recent_pics_cat');
$query = 'SELECT MAX(date_available) AS date
FROM '.IMAGES_TABLE;
- if ($row=mysql_fetch_array( pwg_query($query) ) )
+ if ($row = mysql_fetch_assoc( pwg_query($query) ) )
{
$query = 'SELECT id
FROM '.IMAGES_TABLE.'
diff --git a/admin/element_set_global.php b/admin/element_set_global.php
index 4f223b2cc..20a4c658b 100644
--- a/admin/element_set_global.php
+++ b/admin/element_set_global.php
@@ -245,7 +245,7 @@ SELECT id
;';
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
$data = array();
$data['id'] = $row['id'];
diff --git a/admin/element_set_ranks.php b/admin/element_set_ranks.php
index c8ab6eebf..1bc0ab57f 100644
--- a/admin/element_set_ranks.php
+++ b/admin/element_set_ranks.php
@@ -115,7 +115,7 @@ SELECT uppercats
FROM '.CATEGORIES_TABLE.'
WHERE id = '.$page['category_id'].'
;';
-$category = mysql_fetch_array(pwg_query($query));
+$category = mysql_fetch_assoc(pwg_query($query));
// Navigation path
$navigation = get_cat_display_name_cache(
diff --git a/admin/element_set_unit.php b/admin/element_set_unit.php
index 67f5a62e6..7bc0e54b0 100644
--- a/admin/element_set_unit.php
+++ b/admin/element_set_unit.php
@@ -56,7 +56,7 @@ SELECT id, date_creation
;';
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
$data = array();
diff --git a/admin/group_list.php b/admin/group_list.php
index ab2e8ae7c..97ee5a8f3 100644
--- a/admin/group_list.php
+++ b/admin/group_list.php
@@ -175,7 +175,7 @@ $del_url = $admin_url.'group_list&amp;delete=';
$members_url = $admin_url.'user_list&amp;group=';
$toggle_is_default_url = $admin_url.'group_list&amp;toggle_is_default=';
-while ($row = mysql_fetch_array($result))
+while ($row = mysql_fetch_assoc($result))
{
$query = '
SELECT COUNT(*)
diff --git a/admin/group_perm.php b/admin/group_perm.php
index 7b8538c6c..89a8b43ae 100644
--- a/admin/group_perm.php
+++ b/admin/group_perm.php
@@ -79,7 +79,7 @@ SELECT id
AND status = \'private\'
;';
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
array_push($private_uppercats, $row['id']);
}
@@ -96,7 +96,7 @@ SELECT cat_id
;';
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
array_push($authorized_ids, $row['cat_id']);
}
@@ -157,7 +157,7 @@ display_select_cat_wrapper($query_true,array(),'category_option_true');
$result = pwg_query($query_true);
$authorized_ids = array();
-while ($row = mysql_fetch_array($result))
+while ($row = mysql_fetch_assoc($result))
{
array_push($authorized_ids, $row['id']);
}
diff --git a/admin/history.php b/admin/history.php
index c357a498f..1560d428b 100644
--- a/admin/history.php
+++ b/admin/history.php
@@ -257,7 +257,7 @@ SELECT '.$conf['user_fields']['id'].' AS id
$result = pwg_query($query);
$username_of = array();
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
$username_of[$row['id']] = $row['username'];
}
@@ -305,7 +305,7 @@ SELECT
$tn_ext_of_image = array();
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
$label_of_image[ $row['id'] ] = $row['label'];
@@ -341,7 +341,7 @@ SELECT
$name_of_tag = array();
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
$name_of_tag[ $row['id'] ] = $row['name'];
}
diff --git a/admin/include/c13y_internal.class.php b/admin/include/c13y_internal.class.php
index 8065cbbb2..c807ac24c 100644
--- a/admin/include/c13y_internal.class.php
+++ b/admin/include/c13y_internal.class.php
@@ -126,7 +126,7 @@ class c13y_internal
$status = array();
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
$status[$row['id']] = $row['status'];
}
diff --git a/admin/include/functions.php b/admin/include/functions.php
index 63a79a2bf..f023a7a5d 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -36,7 +36,7 @@ SELECT id
;';
$result = pwg_query($query);
$category_ids = array();
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
array_push($category_ids, $row['id']);
}
@@ -77,7 +77,7 @@ SELECT id
;';
$result = pwg_query($query);
$element_ids = array();
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
array_push($element_ids, $row['id']);
}
@@ -544,7 +544,7 @@ SHOW FULL COLUMNS FROM '.$tablename;
$result = pwg_query($query);
$columns = array();
$all_fields = array_merge($dbfields['primary'], $dbfields['update']);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
if (in_array($row['Field'], $all_fields))
{
@@ -630,7 +630,7 @@ SELECT id, if(id_uppercat is null,\'\',id_uppercat) AS id_uppercat, uppercats, r
$current_uppercat = '';
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
if ($row['id_uppercat'] != $current_uppercat)
{
@@ -776,7 +776,7 @@ SELECT uppercats
WHERE id IN ('.implode(',', $cat_ids).')
;';
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
$uppercats = array_merge($uppercats,
explode(',', $row['uppercats']));
@@ -803,7 +803,7 @@ SELECT image_id
ORDER BY RAND()
LIMIT 0,1
;';
- list($representative) = mysql_fetch_array(pwg_query($query));
+ list($representative) = mysql_fetch_row(pwg_query($query));
array_push(
$datas,
@@ -863,7 +863,7 @@ SELECT id, uppercats, site_id
'.wordwrap(implode(', ', $cat_ids), 80, "\n").')
;';
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
array_push($categories, $row);
}
@@ -1139,7 +1139,7 @@ SELECT element_id,
$datas = array();
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
array_push(
$datas,
@@ -1206,7 +1206,7 @@ SELECT id, id_uppercat, status, uppercats
WHERE id IN ('.implode(',', $category_ids).')
;';
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
$categories[$row['id']] =
array(
@@ -1355,7 +1355,7 @@ SELECT MAX(rank)
FROM '.CATEGORIES_TABLE.'
WHERE id_uppercat '.(is_numeric($parent_id) ? '= '.$parent_id : 'IS NULL').'
;';
- list($current_rank) = mysql_fetch_array(pwg_query($query));
+ list($current_rank) = mysql_fetch_row(pwg_query($query));
$insert = array(
'name' => $category_name,
@@ -1371,21 +1371,21 @@ SELECT id, uppercats, global_rank, visible, status
FROM '.CATEGORIES_TABLE.'
WHERE id = '.$parent_id.'
;';
- $parent = mysql_fetch_array(pwg_query($query));
+ $parent = mysql_fetch_assoc(pwg_query($query));
- $insert{'id_uppercat'} = $parent{'id'};
- $insert{'global_rank'} = $parent{'global_rank'}.'.'.$insert{'rank'};
+ $insert['id_uppercat'] = $parent['id'];
+ $insert['global_rank'] = $parent['global_rank'].'.'.$insert['rank'];
// at creation, must a category be visible or not ? Warning : if the
// parent category is invisible, the category is automatically create
// invisible. (invisible = locked)
if ('false' == $parent['visible'])
{
- $insert{'visible'} = 'false';
+ $insert['visible'] = 'false';
}
else
{
- $insert{'visible'} = boolean_to_string($conf['newcat_default_visible']);
+ $insert['visible'] = boolean_to_string($conf['newcat_default_visible']);
}
// at creation, must a category be public or private ? Warning : if the
@@ -1393,18 +1393,18 @@ SELECT id, uppercats, global_rank, visible, status
// private.
if ('private' == $parent['status'])
{
- $insert{'status'} = 'private';
+ $insert['status'] = 'private';
}
else
{
- $insert{'status'} = $conf['newcat_default_status'];
+ $insert['status'] = $conf['newcat_default_status'];
}
}
else
{
- $insert{'visible'} = boolean_to_string($conf['newcat_default_visible']);
- $insert{'status'} = $conf['newcat_default_status'];
- $insert{'global_rank'} = $insert{'rank'};
+ $insert['visible'] = boolean_to_string($conf['newcat_default_visible']);
+ $insert['status'] = $conf['newcat_default_status'];
+ $insert['global_rank'] = $insert['rank'];
}
// we have then to add the virtual category
@@ -1609,7 +1609,7 @@ function do_maintenance_all_tables()
// List all tables
$query = 'SHOW TABLES LIKE \''.$prefixeTable.'%\'';
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
array_push($all_tables, $row[0]);
}
@@ -1625,7 +1625,7 @@ function do_maintenance_all_tables()
$query = 'DESC '.$table_name.';';
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
if ($row['Key'] == 'PRI')
{
diff --git a/admin/include/functions_metadata.php b/admin/include/functions_metadata.php
index c015b9e91..5bf36439d 100644
--- a/admin/include/functions_metadata.php
+++ b/admin/include/functions_metadata.php
@@ -259,7 +259,7 @@ SELECT id
$query.= '
;';
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
array_push($cat_ids, $row['id']);
}
@@ -284,7 +284,7 @@ SELECT id, path
$query.= '
;';
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
$files[$row['id']] = $row['path'];
}
diff --git a/admin/include/functions_notification_by_mail.inc.php b/admin/include/functions_notification_by_mail.inc.php
index 9f631560b..11b9454f4 100644
--- a/admin/include/functions_notification_by_mail.inc.php
+++ b/admin/include/functions_notification_by_mail.inc.php
@@ -167,7 +167,7 @@ order by';
$result = pwg_query($query);
if (!empty($result))
{
- while ($nbm_user = mysql_fetch_array($result))
+ while ($nbm_user = mysql_fetch_assoc($result))
{
array_push($data_users, $nbm_user);
}
diff --git a/admin/include/functions_permalinks.php b/admin/include/functions_permalinks.php
index e0a024161..85820dba2 100644
--- a/admin/include/functions_permalinks.php
+++ b/admin/include/functions_permalinks.php
@@ -52,7 +52,7 @@ SELECT c.id
$result = pwg_query($query);
$cat_id = null;
if ( mysql_num_rows($result) )
- list( $cat_id ) = mysql_fetch_array($result);
+ list( $cat_id ) = mysql_fetch_row($result);
return $cat_id;
}
@@ -74,7 +74,7 @@ SELECT permalink
$result = pwg_query($query);
if ( mysql_num_rows($result) )
{
- list($permalink) = mysql_fetch_array($result);
+ list($permalink) = mysql_fetch_row($result);
}
if ( !isset($permalink) )
{// no permalink; nothing to do
diff --git a/admin/notification_by_mail.php b/admin/notification_by_mail.php
index 0da5ccbab..11863b7f5 100644
--- a/admin/notification_by_mail.php
+++ b/admin/notification_by_mail.php
@@ -150,7 +150,7 @@ order by
$inserts = array();
$check_key_list = array();
- while ($nbm_user = mysql_fetch_array($result))
+ while ($nbm_user = mysql_fetch_assoc($result))
{
// Calculate key
$nbm_user['check_key'] = find_available_check_key();
@@ -512,7 +512,7 @@ switch ($page['mode'])
$updated_param_count = 0;
// Update param
$result = pwg_query('select param, value from '.CONFIG_TABLE.' where param like \'nbm\\_%\'');
- while ($nbm_user = mysql_fetch_array($result))
+ while ($nbm_user = mysql_fetch_assoc($result))
{
if (isset($_POST[$nbm_user['param']]))
{
diff --git a/admin/picture_modify.php b/admin/picture_modify.php
index c142ae955..30b9db972 100644
--- a/admin/picture_modify.php
+++ b/admin/picture_modify.php
@@ -175,7 +175,7 @@ SELECT *
FROM '.IMAGES_TABLE.'
WHERE id = '.$_GET['image_id'].'
;';
-$row = mysql_fetch_array(pwg_query($query));
+$row = mysql_fetch_assoc(pwg_query($query));
$storage_category_id = null;
if (!empty($row['storage_category_id']))
@@ -324,7 +324,7 @@ SELECT category_id, uppercats
;';
$result = pwg_query($query);
-while ($row = mysql_fetch_array($result))
+while ($row = mysql_fetch_assoc($result))
{
$name =
get_cat_display_name_cache(
@@ -417,7 +417,7 @@ if (isset($storage_category_id))
{
array_push($associateds, $storage_category_id);
}
-while ($row = mysql_fetch_array($result))
+while ($row = mysql_fetch_assoc($result))
{
array_push($associateds, $row['id']);
}
diff --git a/admin/rating.php b/admin/rating.php
index e2f614abe..da19b6b7a 100644
--- a/admin/rating.php
+++ b/admin/rating.php
@@ -94,7 +94,7 @@ SELECT '.$conf['user_fields']['username'].' as username, '.$conf['user_fields'][
FROM '.USERS_TABLE.'
;';
$result = pwg_query($query);
-while ($row = mysql_fetch_array($result))
+while ($row = mysql_fetch_assoc($result))
{
$users[$row['id']]=$row['username'];
}
@@ -214,7 +214,7 @@ ORDER BY date DESC;';
'rates' => array()
);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
$url_del = PHPWG_ROOT_PATH.'admin.php'.
diff --git a/admin/site_manager.php b/admin/site_manager.php
index 06687a274..faec41166 100644
--- a/admin/site_manager.php
+++ b/admin/site_manager.php
@@ -98,7 +98,7 @@ SELECT COUNT(id) AS count
FROM '.SITES_TABLE.'
WHERE galleries_url = \''.$url.'\'
;';
- $row = mysql_fetch_array(pwg_query($query));
+ $row = mysql_fetch_assoc(pwg_query($query));
if ($row['count'] > 0)
{
array_push($page['errors'],
@@ -167,7 +167,7 @@ SELECT galleries_url
FROM '.SITES_TABLE.'
WHERE id = '.$page['site'].'
;';
- list($galleries_url) = mysql_fetch_array(pwg_query($query));
+ list($galleries_url) = mysql_fetch_row(pwg_query($query));
switch($_GET['action'])
{
case 'generate' :
@@ -236,7 +236,7 @@ SELECT *
;';
$result = pwg_query($query);
-while ($row = mysql_fetch_array($result))
+while ($row = mysql_fetch_assoc($result))
{
$is_remote = url_is_remote($row['galleries_url']);
$base_url = PHPWG_ROOT_PATH.'admin.php';
diff --git a/admin/site_update.php b/admin/site_update.php
index b260a5db9..543c7f718 100644
--- a/admin/site_update.php
+++ b/admin/site_update.php
@@ -185,7 +185,7 @@ SELECT id, uppercats, global_rank, status, visible
SELECT id
FROM '.CATEGORIES_TABLE;
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
$next_rank[$row['id']] = 1;
}
@@ -196,7 +196,7 @@ SELECT id_uppercat, MAX(rank)+1 AS next_rank
FROM '.CATEGORIES_TABLE.'
GROUP BY id_uppercat';
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
// for the id_uppercat NULL, we write 'NULL' and not the empty string
if (!isset($row['id_uppercat']) or $row['id_uppercat'] == '')
@@ -210,7 +210,7 @@ SELECT id_uppercat, MAX(rank)+1 AS next_rank
$query = '
SELECT IF(MAX(id)+1 IS NULL, 1, MAX(id)+1) AS next_id
FROM '.CATEGORIES_TABLE;
- list($next_id) = mysql_fetch_array(pwg_query($query));
+ list($next_id) = mysql_fetch_row(pwg_query($query));
// retrieve sub-directories fulldirs from the site reader
$fs_fulldirs = $site_reader->get_full_directories($basedir);
@@ -386,7 +386,7 @@ SELECT file,storage_category_id
'.wordwrap(implode(', ', $cat_ids), 80, "\n").')
AND validated = \'false\'';
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
array_push(
$db_unvalidated,
@@ -402,7 +402,7 @@ SELECT file,storage_category_id
$query = '
SELECT IF(MAX(id)+1 IS NULL, 1, MAX(id)+1) AS next_element_id
FROM '.IMAGES_TABLE;
- list($next_element_id) = mysql_fetch_array(pwg_query($query));
+ list($next_element_id) = mysql_fetch_row(pwg_query($query));
$start = get_moment();
@@ -555,7 +555,7 @@ SELECT id,file,storage_category_id,infos
$waiting_to_delete = array();
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
$data = array();
@@ -564,7 +564,7 @@ SELECT id
FROM '.IMAGES_TABLE.'
WHERE storage_category_id = '.$row['storage_category_id'].'
AND file = \''.$row['file'].'\'';
- list($data['id']) = mysql_fetch_array(pwg_query($query));
+ list($data['id']) = mysql_fetch_row(pwg_query($query));
foreach ($fields['update'] as $field)
{
diff --git a/admin/stats.php b/admin/stats.php
index 0ecfd3f50..600cfcb6e 100644
--- a/admin/stats.php
+++ b/admin/stats.php
@@ -95,7 +95,7 @@ SELECT
$result = pwg_query($query);
$output = array();
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
array_push($output, $row);
}
@@ -133,7 +133,7 @@ $max_id = 0;
$is_first = true;
$first_time_key = null;
-while ($row = mysql_fetch_array($result))
+while ($row = mysql_fetch_assoc($result))
{
$time_keys = array(
substr($row['date'], 0, 4), //yyyy
diff --git a/admin/tags.php b/admin/tags.php
index c4548ef8b..94c5bcb3d 100644
--- a/admin/tags.php
+++ b/admin/tags.php
@@ -49,7 +49,7 @@ SELECT id, name
WHERE id IN ('.$_POST['edit_list'].')
;';
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
$current_name_of[ $row['id'] ] = $row['name'];
}
@@ -220,7 +220,7 @@ SELECT id, name
WHERE id IN ('.implode(',', $_POST['tags']).')
;';
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
$name_of[ $row['id'] ] = $row['name'];
}
diff --git a/admin/upload.php b/admin/upload.php
index a8b88ccf2..b36906778 100644
--- a/admin/upload.php
+++ b/admin/upload.php
@@ -100,7 +100,7 @@ SELECT id, storage_category_id, file, tn_ext
WHERE id IN ('.implode(',', $to_reject).')
;';
$result = pwg_query($query);
- while($row = mysql_fetch_array($result))
+ while($row = mysql_fetch_assoc($result))
{
$dir = get_complete_dir($row['storage_category_id']);
unlink($dir.$row['file']);
@@ -153,7 +153,7 @@ $query.= " WHERE validated = 'false'";
$query.= ' ORDER BY storage_category_id';
$query.= ';';
$result = pwg_query( $query );
-while ( $row = mysql_fetch_array( $result ) )
+while ( $row = mysql_fetch_assoc( $result ) )
{
if ( !isset( $cat_names[$row['storage_category_id']] ) )
{
diff --git a/admin/user_list.php b/admin/user_list.php
index 45e4380a5..73c1537bb 100644
--- a/admin/user_list.php
+++ b/admin/user_list.php
@@ -115,7 +115,7 @@ SELECT DISTINCT u.'.$conf['user_fields']['id'].' AS id,
;';
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
$user = $row;
$user['groups'] = array();
@@ -139,7 +139,7 @@ SELECT user_id, group_id
WHERE user_id IN ('.implode(',', $user_ids).')
;';
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
array_push(
$users[$user_nums[$row['user_id']]]['groups'],
@@ -492,7 +492,7 @@ SELECT id, name
;';
$result = pwg_query($query);
-while ($row = mysql_fetch_array($result))
+while ($row = mysql_fetch_assoc($result))
{
$groups[$row['id']] = $row['name'];
}
diff --git a/admin/user_perm.php b/admin/user_perm.php
index b8ad21edf..1d3b300f0 100644
--- a/admin/user_perm.php
+++ b/admin/user_perm.php
@@ -78,7 +78,7 @@ SELECT id
AND status = \'private\'
;';
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
array_push($private_uppercats, $row['id']);
}
@@ -95,7 +95,7 @@ SELECT cat_id
;';
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
array_push($authorized_ids, $row['cat_id']);
}
@@ -158,7 +158,7 @@ $result = pwg_query($query);
if (mysql_num_rows($result) > 0)
{
$cats = array();
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
array_push($cats, $row);
array_push($group_authorized, $row['cat_id']);
@@ -191,7 +191,7 @@ display_select_cat_wrapper($query_true,array(),'category_option_true');
$result = pwg_query($query_true);
$authorized_ids = array();
-while ($row = mysql_fetch_array($result))
+while ($row = mysql_fetch_assoc($result))
{
array_push($authorized_ids, $row['id']);
}