Fix issue with null values passed natively to DB query statements as bound statements

This commit is contained in:
Dan Stillman 2006-06-27 14:14:40 +00:00
parent 3b119d4c6e
commit bc18f42f81

View file

@ -171,17 +171,17 @@ Scholar.DB = new function(){
if (statement && params){
for (var i=0; i<params.length; i++){
// Integer
if (typeof params[i]['int'] != 'undefined'){
if (params[i]!==null && typeof params[i]['int'] != 'undefined'){
var type = 'int';
var value = params[i]['int'];
}
// String
else if (typeof params[i]['string'] != 'undefined'){
else if (params[i]!==null && typeof params[i]['string'] != 'undefined'){
var type = 'string';
var value = params[i]['string'];
}
// Null
else if (typeof params[i]['null'] != 'undefined'){
else if (params[i]!==null && typeof params[i]['null'] != 'undefined'){
var type = 'null';
}
// Automatic (trust the JS type)
@ -195,8 +195,7 @@ Scholar.DB = new function(){
break;
// Object
default:
// Null value will show as object
if (!params[i]){
if (params[i]===null){
var type = 'null';
}
else {