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:
parent
781dd918fe
commit
de897c51a1
|
@ -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
|
||||
|
|
|
@ -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)";
|
||||
|
|
Loading…
Reference in New Issue