2010-09-23 Sergio Martin <sergio.martin@artica.es>

* lib/PandoraFMS/DB.pm: Improved the db_process_insert
	function against the null values



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3282 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2010-09-23 11:29:08 +00:00
parent 781dd918fe
commit de897c51a1
2 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2010-09-23 Sergio Martin <sergio.martin@artica.es>
* lib/PandoraFMS/DB.pm: Improved the db_process_insert
function against the null values
2010-09-23 Sergio Martin <sergio.martin@artica.es>
* lib/PandoraFMS/DB.pm: Added a function db_process_insert

View File

@ -321,6 +321,13 @@ sub db_process_insert($$$;@) {
}
my $columns_string = join(',',@columns_array);
for (my $i=0; $i<=$#values_array; $i++) {
if(!defined($values_array[$i])) {
$values_array[$i] = '';
}
}
my $values_string = "'".join("','",@values_array)."'";
my $query = "INSERT INTO $table ($columns_string) VALUES ($values_string)";