-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdecomposition.php
More file actions
65 lines (59 loc) · 1.53 KB
/
decomposition.php
File metadata and controls
65 lines (59 loc) · 1.53 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
echo "<html>\n";
echo "<body>\n";
$decomposition= array(
array (
'Rid' => '1',
'product1' => 'NH3',
'product2' => null,
'product3' => null,
'reactant1' => 'N2',
'reactant2' => 'H2',
'reactant3' => null,
),
array (
'Rid' => '2',
'product1' => 'H2O',
'product2' => null,
'product3' => null,
'reactant1' => 'H2',
'reactant2' => 'O2',
'reactant3' => null,
),
array (
'Rid' => '3',
'product1' => 'HgO',
'product2' => null,
'product3' => null,
'reactant1' => 'Hg',
'reactant2' => 'O2',
'reactant3' => null,
),
array (
'Rid' => '4',
'product1' => 'MgCl2',
'product2' => null,
'product3' => null,
'reactant1' => 'Mg',
'reactant2' => 'Cl2',
'reactant3' => null,
),
array (
'Rid' => '5',
'product1' => 'Al2O3',
'product2' => null,
'product3' => null,
'reactant1' => 'Al',
'reactant2' => 'O2',
'reactant3' => null,
),
);
include 'mysql.php';
foreach($decomposition as $data) {
$dec = "INSERT INTO decomposition (Rid, product1, product2, product3, reactant1, reactant2, reactant3)
VALUES ('$data[Rid]', '$data[product1]', '$data[product2]', '$data[product3]', '$data[reactant1]', '$data[reactant2]', '$data[reactant3]')";
#echo $dec;
tes($dec);
echo "successfully inserted a reaction";
}
?>