aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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
+?>