-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathacidBase.php
More file actions
64 lines (59 loc) · 1.59 KB
/
acidBase.php
File metadata and controls
64 lines (59 loc) · 1.59 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
<?php
echo "<html>\n";
echo "<body>\n";
$acidBase= array(
array (
'Rid' =>'1',
'reactant1' => 'HCl',
'reactant2' => 'NaOH',
'reactant3' => null,
'product1' => 'NaCl',
'product2' => 'H2O',
'product3' => null,
),
array (
'Rid' =>'2',
'reactant1' => 'H2SO4',
'reactant2' => 'NaOH',
'reactant3' => null,
'product1' => 'Na2SO4',
'product2' => 'H2O',
'product3' => null,
),
array (
'Rid' =>'3',
'reactant1' => 'Mg',
'reactant2' => 'HCl',
'reactant3' => null,
'product1' => 'MgCl2',
'product2' => 'H2',
'product3' => null,
),
array (
'Rid' =>'4',
'reactant1' => 'Zn',
'reactant2' => 'HCl',
'reactant3' => null,
'product1' => 'ZnCl2',
'product2' => 'H2',
'product3' => null,
),
array (
'Rid' =>'5',
'reactant1' => 'Mg',
'reactant2' => 'H2SO4',
'reactant3' => null,
'product1' => 'MgSO4',
'product2' => 'H2',
'product3' => null,
),
);
include 'mysql.php';
foreach($acidBase as $data) {
$acid = "INSERT INTO acidBase (Rid, reactant1, reactant2, reactant3, product1, product2, product3)
VALUES ('$data[Rid]', '$data[reactant1]', '$data[reactant2]', '$data[reactant3]', '$data[product1]', '$data[product2]', '$data[product3]')";
#echo $acid;
seven($acid);
echo "successfully inserted a reaction";
}
?>