From ce4b79e7b0a359c4f751321eee9cf54464098313 Mon Sep 17 00:00:00 2001 From: z0rglub Date: Sun, 3 Oct 2004 11:12:56 +0000 Subject: 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 --- include/functions_user.inc.php | 13 +++++++++++-- 1 file 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 +?> -- cgit v1.2.3