-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaddtest.php
More file actions
39 lines (32 loc) · 858 Bytes
/
addtest.php
File metadata and controls
39 lines (32 loc) · 858 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
<?php
session_start();
if(!empty($_POST))
{
if(isset($_POST['entry']))
{
include("./database/db_connection.php");
/*if($con->connect_error)
{
die('Connect Error:'.$con->connect_errorno.':'.$con->connect_error);
}*/
$item=$_SESSION['Nam'];
$quantity=$_SESSION['Quan'];
$price=$_SESSION['Pric'];
$item2=$_SESSION['Nam2'];
$quantity2=$_SESSION['Quan2'];
$price2=$_SESSION['Pric2'];
$item3=$_SESSION['Nam3'];
$quantity3=$_SESSION['Quan3'];
$price3=$_SESSION['Pric3'];
$sql="INSERT INTO `daily_purchase` (`Item`, `Quantitry`, `Price`) VALUES ('$item', '$quantity', '$price'),('$item2', '$quantity2', '$price2'),('$item3', '$quantity3', '$price3')";
if($con->Query($sql)===TRUE)
{
echo "Data Successfully Enterd";
}
else
{
echo "Error".$sql."<br>".$con->error;
}
}
}
?>