-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpfindmongo.php
More file actions
51 lines (35 loc) · 825 Bytes
/
pfindmongo.php
File metadata and controls
51 lines (35 loc) · 825 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
require "vendor/autoload.php";
$rno=$_POST['rno'];
$cost=$_POST['cost'];
$ssn=$_POST['ssn'];
$client123 = new MongoDB\Client;
//create the datbase and use
$liot = $client123->liot;
/*
//create the collection inside the database
$result1 = $liotdb->createCollection('student_collection');
var_dump($result1);
*/
$pay = $liot->payments;
$insertOneResult = $pay->insertOne(
['Recipt_no'=>$rno,'Cost'=>$cost,'Ssn'=>$ssn]
);
//$ssn$fname$lname$address$email$sgender$s_bday$s_age$paymentmethod$t_period$degreecode
?>
<?php
require "vendor/autoload.php";
$client = new MongoDB\Client;
$liot = $client->liot;
$pays = $liot->payments;
/*
$document = $empcollection->findOne(
['_id'=>'1']
);
var_dump($document);
*/
$documentlist = $pays->find();
foreach ($documentlist as $doc) {
var_dump($doc);
}
?>