when registering a new user, we must take into account that user_category.date_last can be NULL

git-svn-id: http://piwigo.org/svn/branches/release-1_3@548 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
z0rglub
2004-10-03 11:12:56 +00:00
parent 39a466c193
commit ce4b79e7b0
+11 -2
View File
@@ -158,7 +158,16 @@ function register_user( $login, $password, $password_conf,
$query = 'INSERT INTO '.PREFIX_TABLE.'user_category';
$query.= ' (user_id,category_id,date_last,nb_sub_categories) VALUES';
$query.= ' ('.$user_id.','.$row['category_id'];
$query.= ",'".$row['date_last']."',".$row['nb_sub_categories'].')';
$query.= ",";
if (!isset($row['date_last']) or $row['date_last'] == '')
{
$query.= 'NULL';
}
else
{
$query.= "'".$row['date_last']."'";
}
$query.= ",".$row['nb_sub_categories'].')';
$query.= ';';
mysql_query ( $query );
}
@@ -216,4 +225,4 @@ function check_login_authorization()
}
}
}
?>
?>