From 1121543ad99f86990ca5334829bacfbc675ca5c0 Mon Sep 17 00:00:00 2001 From: z0rglub Date: Fri, 30 Jan 2004 22:49:24 +0000 Subject: if a category has no last_date, the corresponding date_last in user_category table is also NULL git-svn-id: http://piwigo.org/svn/branches/release-1_3@334 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/include/functions.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'admin/include/functions.php') diff --git a/admin/include/functions.php b/admin/include/functions.php index b4c12619a..ce7fa076f 100644 --- a/admin/include/functions.php +++ b/admin/include/functions.php @@ -666,12 +666,13 @@ function update_user_category( $categories ) $query.= ')'; $query.= ';'; $row = mysql_fetch_array( mysql_query( $query ) ); - $last_date = $row['last_date']; // insert a new line in database if ( $value_num++ > 0 ) $values.= ', '; else $values.= ' '; - $values.= '('.$user_id.",".$category['id'].",'".$last_date."'"; + $values.= '('.$user_id.",".$category['id']; + if ( isset( $row['last_date'] ) ) $values.= ",'".$row['last_date']."'"; + else $values.= ',NULL'; $values.= ','.$user_nb_subcats.')'; } update_uppercats( $category['id'] ); -- cgit v1.2.3