From 2410839251d72a6947d291f0174a85bcf9b53e53 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Fri, 18 Feb 2011 11:47:42 +0530 Subject: [PATCH] Should be NULL, not 'NULL' --- js/sql.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/sql.js b/js/sql.js index fd3884340..8173b5ee9 100644 --- a/js/sql.js +++ b/js/sql.js @@ -649,9 +649,10 @@ $(document).ready(function() { for (var key in params_to_submit) { value = params_to_submit[key]; if (value.length == 0) { - value = 'NULL'; + sql_query += ' ' + key + "=NULL, "; + } else { + sql_query += ' ' + key + "='" + value.replace(/'/g, "''") + "' , "; } - sql_query += ' ' + key + "='" + value.replace(/'/g, "''") + "' , "; } //Remove the last ',' appended in the above loop sql_query = sql_query.replace(/,\s$/, '');