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
This commit is contained in:
z0rglub 2004-01-30 22:49:24 +00:00
parent 6119c01fbb
commit 1121543ad9

View file

@ -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'] );