-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathpsales.php
34 lines (26 loc) · 802 Bytes
/
psales.php
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
<?php
include_once('dbconnection.php');
$name = $_SESSION['Pass'];
if (isset($_POST['submit']))
{
$query = "SELECT * FROM `membership` WHERE UserName='$name';";
$result = mysqli_query($con, $query);
$row = mysqli_fetch_assoc($result);
if (mysqli_num_rows($result) > 0)
{
// $email = $row['Email'];
$mobileNo = $row['MobileNo'];
}
$PName = $_POST['sell-location'];
echo $PName;
$Quantity = $_POST['quantity'];
$cropid = $_POST['cid'];
$query = "INSERT INTO `cropsales`(`cropid`, `Quantity`, `Name`, `address`, `mobileNo`)
VALUES ('$cropid','$Quantity','$name','$PName','$mobileNo');";
$result = mysqli_query($con, $query);
if($result)
{
header("location:fertilizers.php");
}
}
?>