From 7d51de44ee58de4f10c39775291f6f10ad6c8d42 Mon Sep 17 00:00:00 2001 From: plegall Date: Mon, 7 Feb 2005 21:44:21 +0000 Subject: - bug fixed : can't find a new category id for virtual category creation if no existing category. git-svn-id: http://piwigo.org/svn/trunk@728 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/cat_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/cat_list.php b/admin/cat_list.php index bcfe152f2..b5b4a6852 100644 --- a/admin/cat_list.php +++ b/admin/cat_list.php @@ -78,7 +78,7 @@ SELECT id,uppercats,global_rank,visible,status // what will be the inserted id ? $query = ' -SELECT MAX(id)+1 +SELECT IF(MAX(id)+1 IS NULL, 1, MAX(id)+1) FROM '.CATEGORIES_TABLE.' ;'; list($next_id) = mysql_fetch_array(pwg_query($query)); -- cgit v1.2.3