aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2004-10-03 11:12:56 +0000
committerz0rglub <z0rglub@piwigo.org>2004-10-03 11:12:56 +0000
commitce4b79e7b0a359c4f751321eee9cf54464098313 (patch)
treea9c4c199718311cd434b729683f2d4241c5fac55 /include
parent39a466c193bd34c1f54d5f195a31a3c4bf263887 (diff)
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
Diffstat (limited to 'include')
-rw-r--r--include/functions_user.inc.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php
index 95ca7bb3c..3288108bf 100644
--- a/include/functions_user.inc.php
+++ b/include/functions_user.inc.php
@@ -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()
}
}
}
-?> \ No newline at end of file
+?>