Multiple insert

This commit is contained in:
Jaroslav Drzik
2021-12-10 18:03:15 +01:00
parent 0cde20881a
commit f0399c9c9d
2 changed files with 10 additions and 13 deletions

View File

@@ -111,20 +111,17 @@ print_r($states_ids);
[ '1' => '1' ]
);
$ids = [];
foreach ($checked as $s) {
echo $s->computers_id." ";
$comp = new Computer();
$comp->getFromDB($s->computers_id);
$comp->fields["states_id"] = $states_ids["Online"];
$DB->update("glpi_computers", [
'states_id' => $comp->fields["states_id"] ],
[ 'id' => $s->computers_id ]
);
echo $comp->fields["contact"]."\n";
echo $s->computers_id."\n";
$ids[] = $s->computers_id;
}
$DB->update("glpi_computers", [
'states_id' => $states_ids["Online"] ],
[ 'id' => $ids ]
);
// print_r($a_computerextend);
exit(0);