-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinsert.php
More file actions
32 lines (27 loc) · 1.03 KB
/
insert.php
File metadata and controls
32 lines (27 loc) · 1.03 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
<?php
$surveyno = $_POST['surveyno'];
$district = $_POST['district'];
$blockpanchayath = $_POST['blockpanchayath'];
$panchayath = $_POST['panchayath'];
$location =$_POST['location'];
$pno = $_POST['pno'];
$annualprecp = $_POST['annualprecp'];
$organicc = $_POST['organicc'];
$phosphorous = $_POST['phosphorous'];
$potassium = $_POST['potassium'];
$ph = $_POST['ph'];
$output =$_POST['output'];
$conn = new mysqli('localhost','root','abc1','phplogin');
if ($conn -> connect_error){
die('Connection Failed :'. $conn -> connect_error);
}
else{
$stmt = $conn -> prepare("Insert into dataset(surveyno, district, blockpanchayath, panchayath, location, pno, annualprecp, organicc, phosphorous, potassium, ph, output)
values(?,?,?,?,?,?,?,?,?,?,?,?)");
$stmt -> bind_param( "sssssidddddi", $surveyno, $district, $blockpanchayath, $panchayath, $location, $pno, $annualprecp, $organicc, $phosphorous, $potassium, $ph, $output);
$stmt -> execute();
echo "Registration successful";
$stmt -> close();
$conn -> close();
}
?>