-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdateam.php
More file actions
33 lines (26 loc) · 727 Bytes
/
updateam.php
File metadata and controls
33 lines (26 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
require "vendor/autoload.php";
$client = new MongoDB\Client;
$liot = $client->liot;
$studentcollection = $liot->studentcollection;
$npos=$_GET['npos'];
$essn =$_GET['aid'];
$posit=$_GET['pos'];
/*
$updateResult = $empcollection->updateOne(
['age'=>'32'],
['$set' => ['age'=>'23']]
);
*/
$replaceResult = $studentcollection->replaceOne(
['SSN' => $essn],
['SSN' => $essn, 'Position' =>$nadd ]
);
/*
printf("Matched %d documents \n",$replaceResult->getMatchedCount());
printf("Modified %d documents \n",$replaceResult->getModifiedCount());
);
*/
printf("Matched %d documents \n",$replaceResult->getMatchedCount());
printf("Modified %d documents \n",$replaceResult->getModifiedCount());
?>