- 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
This commit is contained in:
plegall
2005-02-07 21:44:21 +00:00
parent 357ed72163
commit 7d51de44ee
+1 -1
View File
@@ -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));