-
Notifications
You must be signed in to change notification settings - Fork 0
/
roomform.php
39 lines (28 loc) · 936 Bytes
/
roomform.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
35
36
37
38
39
<?php
$conn=mysqli_connect("localhost","root","","home");
if(!$conn){
die("connection failed".mysqli_connect_error());
}
echo "succesfull";
$name =$_POST['name'];
$location=$_POST['location'];
$rent=$_POST['rent'];
$meal=$_POST['meal'];
$bhk=$_POST['bhk'];
$date=$_POST['date'];
$roomtype =$_POST['roomtype'];
$furniture=$_POST['furniture'];
$accupancy=$_POST['accupancy'];
$gender =$_POST['gender'];
$amenities=$_POST['amenities'];
$amen=implode(",",$amenities);
$query="INSERT INTO roomform(name,location,rent,meal,bhk,date,roomtype,furniture,accupancy,gender,amenities)
VALUES('$name','$location','$rent','$meal','$bhk','$date','$roomtype','$furniture','$accupancy','$gender','$amen')";
$data=mysqli_query($conn,$query);
if($data){
echo"Data inserted successfully";
}
else{
echo"Data insertion failed";
}
?>