Bug #3184827 Inline edit fails on some tables
This commit is contained in:
12
js/sql.js
12
js/sql.js
@@ -643,12 +643,16 @@ $(document).ready(function() {
|
|||||||
*/
|
*/
|
||||||
var sql_query = 'UPDATE ' + window.parent.table + ' SET ';
|
var sql_query = 'UPDATE ' + window.parent.table + ' SET ';
|
||||||
|
|
||||||
$.each(params_to_submit, function(key, value) {
|
// $.each() not used here since it cause problems when there is a column
|
||||||
if(value.length == 0) {
|
// in the table with the name 'length'. See bug #3184827
|
||||||
value = 'NULL'
|
var value;
|
||||||
|
for (var key in params_to_submit) {
|
||||||
|
value = params_to_submit[key];
|
||||||
|
if (value.length == 0) {
|
||||||
|
value = 'NULL';
|
||||||
}
|
}
|
||||||
sql_query += ' ' + key + "='" + value.replace(/'/g, "''") + "' , ";
|
sql_query += ' ' + key + "='" + value.replace(/'/g, "''") + "' , ";
|
||||||
})
|
}
|
||||||
//Remove the last ',' appended in the above loop
|
//Remove the last ',' appended in the above loop
|
||||||
sql_query = sql_query.replace(/,\s$/, '');
|
sql_query = sql_query.replace(/,\s$/, '');
|
||||||
sql_query += ' WHERE ' + PMA_urldecode(where_clause);
|
sql_query += ' WHERE ' + PMA_urldecode(where_clause);
|
||||||
|
Reference in New Issue
Block a user